Hacker News new | ask | show | jobs
by gpderetta 1097 days ago
call/cc as the only control flow primitive!
2 comments

Algebraic effects use delimited continuations (and this appears to match toss/return). Call/cc captures an undelimited continuation. Totally different.
Yes delimited continuations are better in practice, but call/cc is more iconic.
Also called "continuation monad", which can be proven to be universal.

So, no surprise.

These three comments as a chain are hilariously close to the paper ‘On the Expressive Power of User-Defined Effects: Effect Handlers, Monadic Reflection, Delimited Control’ by Forster,Kammar,Lindley,Pretnar. It’s relatively new and evaluates the expressive power of the three concepts, which barring preserving typability during translation, are equivalent.

1 - https://ps.uni-saarland.de/Publications/documents/ForsterEtA...

You can match return types across continuations with delimited dynamic variables, an extension of delimited continuations

http://okmij.org/ftp/papers/DDBinding.pdf