3 ms·
> How is this substantively different than using an ApplicativeError or MonadError[0] type class? It think it's about static vs. dynamic behavior. In monadic
by cryptonector 1y ago
> How is this substantively different than using an ApplicativeError or MonadError[0] type class?
It think it's about static vs. dynamic behavior.
In monadic programming you have to implement all the relevant methods in your monad, but with effects you can dynamically install effects handlers wherever you need to override whatever the currently in-effect handler would be.
I could see the combination of the two systems being useful. For example you could use a bespoke IO-compatible monad for testing and sandboxing, and still have effects handlers below which.. can still only invoke your IO-like monad.
- tome 1y ago> with effects you can dynamically install effects handlers wherever you need to override whatever the currently in-effect handler would be. You can do that with mtl-style too. It's just more clumsy.