On Tue, 9 Dec 2008, John Lato wrote: > On Tue, Dec 9, 2008 at 4:58 PM, Henning Thielemann > <[EMAIL PROTECTED]> wrote: >> >> What are the reasons, you do not like lazy IO? Yes, currently it's a hack >> using unsafeInterleaveIO. But I hope someday one can hide this safely in a >> nice monad. But in general I find lazy stream processing a very elegant >> way of programming. Why else should we use Haskell and not, say OCaml? > > The main reason I don't like lazy IO is that you need to force > evaluation while the handle is open, or leave handles open.
I think the problem is that readFile style routines are not modular enough. We need open/getContent/close style routines and sadly, composition of them is error-prone. You can easily close a file and try to read data from it afterwards. Maybe continuation style functions (like withCString) are better, but it is still possible to access closed files. It would be very nice if these problems could be solved, since the interim lazy processing is very elegant, and also useful for feedback. _______________________________________________ haskell-art mailing list haskell-art@lurk.org http://lists.lurk.org/mailman/listinfo/haskell-art