3 ms·
Have you thought of using generators as a closest example to compare effects to? I think they are much closer to effects than exceptions are. Great explainer an
by nikita2206 1y ago
Have you thought of using generators as a closest example to compare effects to? I think they are much closer to effects than exceptions are. Great explainer anyway, it was tge first time I have read about this idea and it was immediately obvious
- yen223 1y agoExceptions are usually used because the syntax for "performing" exceptions (throw) vs handling exceptions (try-catch) is familiar to most programmers, and is basically the same as the syntax for "performing" an effect vs handling the effect, except that the latter also includes resuming a function. It would be cool to see how generators will be implemented with algebraic effects.
- iamwil 1y agoFull blown algebraic effects are multi-shot, meaning you can resume from the same raised effect multiple times. Generators can only resume from a point in the execution a single time. But yes, you can implement single-shot effects with generators.