Proposal: end lazy IO results with errors/exceptions

Eric Mertens emertens at
Fri Jul 25 04:05:20 UTC 2014


I think that this change would make otherwise reasonable uses of
hGetContents on large files more likely to end with an exception. It seems
perfectly reasonable to use hGetContents to stream data from a either a
large source or an infinite source (say a pipe or socket or /dev/urandom).
Perhaps you're streaming those bytes into another form, who knows. In any
case, file descriptors are precious and it would make sense to hClose the
file when you're done with it rather than wait and hope that the GC gets to
closing your file.

With this change we'd be introducing asynchronous minefields into code that
don't need to exist.

On Thu, Jul 24, 2014 at 8:50 PM, John Wiegley <johnw at> wrote:

> +1 from me.
> John
> _______________________________________________
> Libraries mailing list
> Libraries at

Eric Mertens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list