juan_gandhi: (VP)
[personal profile] juan_gandhi
Just agreed with Runar that, well, it's not a monad, because there's no associativity (duh)

Or? (ok, ok, lax weak pseudo promonad...)

Date: 2015-01-14 08:41 am (UTC)
From: [identity profile] huzhepidarasa.livejournal.com
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.

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

June 2025

S M T W T F S
1 2345 6 7
8 9 10 11 121314
15161718 1920 21
222324252627 28
29 30     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 6th, 2025 01:52 am
Powered by Dreamwidth Studios