[Haskell-cafe] background question about IO monad

Jonathan Cast jonathanccast at fastmail.fm
Wed Feb 6 22:42:18 EST 2008

On 6 Feb 2008, at 7:30 PM, Uwe Hollerbach wrote:

> Hi, all, thanks for the responses. I understand the distinction
> between pure functions and impure functions/procedures/IO actions,

Um, I'm not sure of that, given what you go on to say.

> it
> just felt to me in the samples that I quoted that I was in fact
> starting from basically the starting point,

Not really.  The key difference to understand is that between  
difference between getCurrentTime and toUTCTime 42.  These are your  
`starting points' --- the rest is just pure code.

> eventually getting to the
> same endpoint (or at least a pair of endpoints that are not easily
> distinguished from each other by looking just at code), and inbetween

Well, the in-between paths are pure (or can be) either way.  It's the  
starting point that needs liftIO or not.

> one path was going through liftIO and the other not. But I guess it
> comes down to the fact that, since I'm in a REPL, I'm wallowing in
> impurity all the time (or something like that :-) )


More information about the Haskell-Cafe mailing list