A really dump question...

The associativity law states (using Haskell syntax):

m >>= (\x -> k x >>= h) = (m >>= k) >>= h

What I don't understand is why "bind" can be associative. One use of monad is to encapsulate side-effects. And the order of operations is important when there are side-effects. If so, why does associativity hold?

## Recent comments

3 days 19 hours ago

5 days 13 hours ago

2 weeks 2 days ago

3 weeks 1 day ago

4 weeks 1 day ago

5 weeks 6 days ago

6 weeks 2 days ago

7 weeks 3 days ago

7 weeks 6 days ago

8 weeks 2 hours ago