
2 Oct
2003
2 Oct
'03
12:47 p.m.
W liĆcie z czw, 02-10-2003, godz. 14:25, Juanma Barranquero pisze:
Yeah, I know. But it's difficult to ensure I'm satisfying the laws when I'm not entirely sure what do they ask from me...
1. (return x) >>= f == f x 2. m >>= return == m 3. (m >>= f) >>= g == m >>= (\x -> f x >>= g) My intuition: 1 & 2. return doesn't do anything (except having the given result). If added before or after an action, it doesn't change its effect. 3. (>>=) is associative, so it must not leave trails of where it was applied, it only propagates effects of the arguments being composed. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/