patch applied (packages/base): Make hGetContents throw an exception
if an error is encountered
marlowsd at gmail.com
Tue Oct 13 06:33:48 EDT 2009
Mon Oct 12 08:29:55 PDT 2009 Simon Marlow <marlowsd at gmail.com>
* Make hGetContents throw an exception if an error is encountered
Strictly speaking this breaks Haskell 98 compatibility, which requires
hGetContents to just end the lazy stream silently if an error is
encountered. However, for a few reasons we think it will make
everyone's life a bit easier if we make this change
1. Errors will be a lot more common in GHC 6.12.1, in the form
of Unicode decoding errors.
2. When Haskell 98 was designed, we didn't know how to throw
exceptions from inside lazy I/O, but now we do.
3. If anyone is actually relying on the previous behaviour, their
code is arguably broken.
M ./GHC/IO/Handle/Text.hs -6 +7
View patch online:
More information about the Cvs-libraries