Open pca006132 opened 7 months ago
Hi, see #384 for the reintroduction of async support into Koka.
As feedback on your approach rcontext
should not escape the handler clause (resume will always be resolved locally to a handler clause). Instead store a lambda that calls rcontext.resume
i.e. (fn(x) rcontext.resume(x)
).
Hi, I was trying to use async effect but found that the
std/async
module seems to be removed, which causes some of the tests to fail:I was also trying to implement async using resume, but it seems that I cannot use resume anywhere outside the handler. For example, the following code cannot compile:
Error:
I suspect that resume was called directly, so I tried changing the line to
This failed with
Using raw control:
This also failed with:
Looking at the git blame of the code responsible for the error message, it seems that this is due to a skolem escape check, not sure if it is needed due to effect handler implementation. Is this kind of operation supported?