[Haskell-cafe] Newbie Monad question

Simon Ulfsbäcker ulfsbecker at swipnet.se
Tue Jan 25 14:14:07 EST 2005


Hi,

I'm a functional programming newbie trying to get the hang of the concept of
Monads, but one thing about bind puzzles me. Let's take an IO Monad-example:

readLn >>= \i -> readLn >>= \j -> return (i + j)

I fail to see how (\j -> return (i + j)) can know about the value of i.
Isn't just the value of the previous readLn passed to \j -> return (i + j)?

/Smalmatskungen



More information about the Haskell-Cafe mailing list