News for hackers. Stuff that matters.
Re:Algebraic Effects for the Rest of Us by dan-robertson on Wednesday July 24, 2019 @09:49AM (#20515217)
The second: once a restart is invoked, the stack is unwound and so whatever was happening at the tip is forgotten. With an effect handler one is given a continuation (this might be a function or, as in ocaml, a special function-like thing which may be called only once), and you can put this to one side and do something else.

A common example for an application of algebraic effects would be implementing async/await like mechanisms. The effect handler would take the continuations and put them into a scheduler, so it’s stack would effectively be heavily forked.

There are no comments on this comment yet.