
15 Apr
2015
15 Apr
'15
3:41 p.m.
On Wed, 15 Apr 2015 17:34:50 +0200, Marcin Mrotek
Changing it to, let's say
main = do a <- getLine b <- getLine c <- foo a b
makes it obvious there's no way to evaluate c before a and b, whatever monad that would be, as foo may c can change the shape of the monad anyway it pleases.
import Debug.Trace foo _ _ = return () main = do a <- trace "a" <$> getLine b <- trace "b" <$> getLine c <- trace "c" <$> foo a b print c Running this program: first input second input c () So as you can see, ‘a’ and ‘b’ never get evaluated.