Semi-closed handles and I/O errors: misleading documentation?

6 views
Skip to first unread message

Daniel Díaz

unread,
Nov 29, 2015, 12:00:10 PM11/29/15
to Haskell-cafe
In the documentation for System.IO, we find the following assertion:

Any I/O errors encountered while a handle is semi-closed are simply discarded.

also this other one:

Encoding and decoding errors are always detected and reported, except during lazy I/O (hGetContents, getContents, and readFile), where a decoding error merely results in termination of the character stream, as with other I/O errors.

Is this really correct, though? This SO question says that exceptions found during lazy I/O are thrown from pure code, and a small experiment seems to confirm it. I personally prefer that behaviour, by the way. 

Perhaps the documentation should be updated?
Reply all
Reply to author
Forward
0 new messages