effekt-lang / effekt

A language with lexical effect handlers and lightweight effect polymorphism
https://effekt-lang.org
MIT License
315 stars 19 forks source link

Capture polymorphism #271

Open phischu opened 1 year ago

phischu commented 1 year ago

It would be great if we could abstract over capture sets on the type level:

type Coroutine[C, A] {
  Done()
  More(value: A, next: () => Coroutine[C, A] at C)
}

This way we could actually store first-class functions in data structures.

b-studios commented 1 year ago

/cc @e45lee ;)

b-studios commented 1 year ago

When implementing this, we should also consider #67 since we would need a general form of polymorphism and kind inference.

This is not the easiest task to start, but maybe @dvdvgt and/or @marvinborner are interested in taking up the challenge at some point? :)