Encode immediately in hPutStr and hPutChar
authorSimon Marlow <marlowsd@gmail.com>
Thu, 25 Nov 2010 10:25:20 +0000 (10:25 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Thu, 25 Nov 2010 10:25:20 +0000 (10:25 +0000)
commit5522b142e24b9dbba21a9036746db20e78cf8f43
tree4f3cfc4783ce93833e79008e28da3ee53e3e958d
parent85ed71ab833a40f5acfeb4610a0aa3c3c3e1a35b
Encode immediately in hPutStr and hPutChar
This means that decoding errors will be detected accurately, and can
be caught and handled.  Overall the implementation is simpler this way
too.

It does impose a performance hit on small hPutStrs, although larger
hPutStrs seem to be unaffected.  To compensate somewhat, I optimised
hPutStrLn.
GHC/IO/Handle.hs
GHC/IO/Handle/Internals.hs
GHC/IO/Handle/Text.hs
GHC/IO/Handle/Types.hs
System/IO.hs