Um, no. f >=> g means execute f first, g next. That's what people normally want when they do IO. It is not commutative. Note I say execute, not evaluate. IO values can be evaluated in any order, but after they are evaluated, they are executed by the IO execution mechanism, which is totally separate from the Haskell evaluation mechanism. And the execution is done *in order*. That's why we need the IO monad in the first place.
f >=> (g >=> h) means do f first, then do the combined action (g >=> h).
If you are switching the execution order around you are not doing IO.
no subject
Date: 2015-01-14 08:41 am (UTC)f >=> (g >=> h) means do f first, then do the combined action (g >=> h).
If you are switching the execution order around you are not doing IO.