effekt
effekt copied to clipboard
Higher-order effects and bidirectional effects
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)
Q: Are there any interesting examples we could implement with this?
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.
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
Should hopefully be fixed by #361
Fixed by #361.