On Feb 5, 2008 9:44 PM, Uwe Hollerbach <[EMAIL PROTECTED]> wrote: > lisp> (UTCtime) > "Wed Feb 6 03:57:45 UTC 2008" > --- > lisp> (UTCtime 1.203e9) > "Thu Feb 14 14:40:00 UTC 2008" > -- > But after that, it sure seems to me as if I've taken data out of the > IO monad... haven't I? Given that the second alternative never entered > doIOAction and that after both are done I have a string of characters, > prettily formatted to indicate a time, that's what it feels like to > this unwashed C programmer.
Formatting a time is a completely pure operation. If you give the time formatting function the same timestamp, you always get the same string back. It is getting the *current* time which is in the IO monad, since it "returns" different results depending on at what time it is called. Luke _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe