Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is incredibly funny and also brilliant: toss/return is an implementation of algebraic effects!


call/cc as the only control flow primitive!


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: