3 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. Side effects are not a ty
by 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.