Proposal: end lazy IO results with errors/exceptions

Kim-Ee Yeoh ky3 at atamo.com
Fri Jul 25 05:17:43 UTC 2014


On Fri, Jul 25, 2014 at 11:46 AM, Dan Doel <dan.doel at gmail.com> wrote:

> For an exception to happen, one has to force more than what was already
> forced when the handle was closed. The vast majority of instances of
> this---as far as I can tell---are people immediately closing handles
> they've lazily read from, and an exception is probably more informative
> than the empty input they currently get.


Perhaps Eric's suggesting that the existing behavior provides a simple
asynchronous signalling mechanism?

When reading from an infinite source, an empty read signals that the source
handle was closed elsewhere in a different thread. The reading thread then
acts accordingly, say, branching out of a loop.

(I'm neutral on the proposal and on the haskelliness of everything said so
far. I'm just trying to understand what everyone's saying in this
discussion.)

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140725/28bed2ec/attachment.html>


More information about the Libraries mailing list