3 ms·
>The monad bind operator introduces a data dependency which is responsible for the sequencing itself, not the actual implementation of the bind (i.e. it is a re
by foldr 8y ago
>The monad bind operator introduces a data dependency which is responsible for the sequencing itself, not the actual implementation of the bind (i.e. it is a result of the type of the bind)
No, there is nothing in the type of >>= which guarantees sequencing of side effects. So for example:
a >>= (\b -> c)
There is nothing in the type of >>= that guarantees that a will be completely evaluated before c is evaluated.
I suspect this misconception is what makes many people think that Haskell's way of handling IO has something crucially to do with monads.