3 ms·
This is incredibly funny and also brilliant: toss/return is an implementation of algebraic effects!
by lpghatguy 3y ago
This is incredibly funny and also brilliant: toss/return is an implementation of algebraic effects!
- gpderetta 3y agocall/cc as the only control flow primitive!
- firstlink 3y agoAlgebraic effects use delimited continuations (and this appears to match toss/return). Call/cc captures an undelimited continuation. Totally different.
- gpderetta 3y agoYes delimited continuations are better in practice, but call/cc is more iconic.
- dirkt 3y agoAlso called "continuation monad", which can be proven to be universal. So, no surprise.
- throwaway17_17 3y agoThese 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/ForsterEtAl_2017_Expressiveness-Effects.pdf https://ps.uni-saarland.de/Publications/documents/ForsterEtA...
- alexisread 3y agoYou can match return types across continuations with delimited dynamic variables, an extension of delimited continuations http://okmij.org/ftp/papers/DDBinding.pdf http://okmij.org/ftp/papers/DDBinding.pdf