effekt icon indicating copy to clipboard operation
effekt copied to clipboard

Higher-order effects and bidirectional effects

Open b-studios opened this issue 1 year ago • 4 comments

Right now we can specify interfaces as follows:

interface Proc {
  def fork { f: () => Unit }: Unit
}

we can implement them with new. However, computation is not allowed as arguments when using the try construct.

It is somewhat obvious that this can be combined with bidirectional effects, to establish a sound semantics. So, we should just implement it as:

try {
  ...
} with Proc { 
  def fork() = resume { {f} => ... f()... }
}

(this is dual to #152)

b-studios avatar Sep 28 '23 07:09 b-studios

Q: Are there any interesting examples we could implement with this?

b-studios avatar Sep 28 '23 07:09 b-studios

A first step towards this issue would be to add block parameters to operation declarations and only support them on objects (fail on handlers). Then, in a second step, we can also support handlers.

b-studios avatar Oct 09 '23 12:10 b-studios

For people interested in working on this issue, there is a branch containing first steps at https://github.com/effekt-lang/effekt/tree/higher-order-effects

b-studios avatar Oct 09 '23 15:10 b-studios

Should hopefully be fixed by #361

b-studios avatar Jan 28 '24 13:01 b-studios

Fixed by #361.

jiribenes avatar Mar 22 '24 09:03 jiribenes