
Duncan Coutts wrote:
On Thu, 2006-05-25 at 16:41 -0700, Ashley Yakeley wrote:
Malcolm Wallace wrote:
Oh, I always assume lazy I/O. It is one of the most useful parts of Haskell, and I rely on it all the time for both interactivity and avoidance of space problems.
Lazy I/O is problematic and probably a bad idea for libraries: http://haskell.org/pipermail/haskell/2006-May/017998.html
Assuming we do have imprecise exceptions what is wrong with lazy IO?
I'm not even certain that lazy I/O doesn't upset referential transparency. It seems hard to construct a concrete counter example though. My intuition is something like this: if evaluating a thunk can cause IO to take place, then 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. I'm concerned that in the presence of dependencies between lazy I/O computations, the order of evaluation might be visible. There have been several discussions on this topic, not everyone shares my views :-) eg. http://www.haskell.org//pipermail/haskell-cafe/2003-October/005188.html Actually, in a way I really hope I'm wrong. I would love to use lazy I/O, but I believe we need to have a good story for error handling and possible evaluation-order issues first. Cheers, Simon