[Haskell-cafe] Question about Lazy.IO

staafmeister g.c.stavenga at uu.nl
Tue Sep 1 05:05:42 EDT 2009


I've been wondering about Lazy IO for a while. Suppose we have a program

main = interact (unlines . somefunction . lines)

then somefunction is a pure function. With the semantic interpretation of:
given a input list
return an output list. However I, the user, can change my input depending on
the output of this
function. Now in simple cases like this, this will not be a problem. But
suppose you are reading
and writing to a file. Now the result of pure functions become dependent on
the order of execution,
breaking (I think) referential transparency. Am I wrong here or how could
you prove that Lazy IO
is consistent nonetheless?


View this message in context: http://www.nabble.com/Question-about-Lazy.IO-tp25236848p25236848.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

More information about the Haskell-Cafe mailing list