4 ms·
The IO monad, just like the state monad is still just a type wrapping another thing... In those cases, it is wrapping side-effects. But I don't agree that a bu
by jpc0 2y ago
The IO monad, just like the state monad is still just a type wrapping another thing... In those cases, it is wrapping side-effects.
But I don't agree that a burrito effectively represents a monad purely because as you tried to allude to, a monad is not just about the fact that it is a wrapped time but about what functions are available to it.
Imagine a list with no map, is it really a monad?
https://swlaschin.gitbooks.io/fsharpforfunandprofit/content/posts/elevated-world-7.html https://swlaschin.gitbooks.io/fsharpforfunandprofit/content/...
That whole series is a great breakdown of functors and monads that really opened my eyes. This is near the end but that also means all the links are available.
- bazoom42 2y ago> The IO monad, just like the state monad is still just a type wrapping another thing... In those cases, it is wrapping side-effects. Side effects are not a type though. The “type wrapping another type” in the parent refers to List T and Maybe T where T is the wrapped type. But with IO you can have IO String or IO () representing operations with side-effects, so the analogy breaks down. A common problem with half-baked monad explanations is they generalize from one or two monads and then create an analogy which breaks down for other common monads.