
Simon Marlow
I'm not even certain that lazy I/O doesn't upset referential transparency. ... the act of evaluating that thunk might affect the value of another lazy I/O computation, and hence it should be possible to get different results by evaluating the thunks in a different order.
It might be possible to construct an example using pipes, though.
Haskell program output is piped to a process which feeds the Haskell program's input pipe. External process computes the time it takes for successive items to appear on its input. Voila, the input to Haskell land is dependent on how long it takes to generate its output, and therefore (indirectly) on evaluation order. It's a bit contrived, and I'm not sure it really breaks ref trans either. This kind of feedback oscillator might have interesting chaotic behaviour though! Regards, Malcolm