2 ms·
>Algebraic effects basically mean that you live in a single monad that can be either widened or narrowed via new effects or new handlers respectively. Yep, it
by cultus 8y ago
>Algebraic effects basically mean that you live in a single monad that can be either widened or narrowed via new effects or new handlers respectively.
Yep, it is a restriction as I said. Algebraic effects basically live inside the free monad, so that's what I meant by that.
This restriction, versus using separate Writer, IO, etc, monads, is far more easy to reason about. Types in Haskell become insane with monad transformers. It produces code that is difficult to understand and reuse.
edit: Algebraic effects can also be derived from delimited continuations.
- dwohnitmok 8y agoMaybe I'm just getting hung up on the word restriction. In particular is there any monad that cannot be expressed as a pair of algebraic effects and handlers? I think the answer is no (potentially barring especially magical monads such as IO in its full generality), but I'm not sure. Totally agree about the brittle and type-soup nature of transformer-heavy code.