- Dec 3, 2005 11:25:32 AM (8 years ago)
v1 v2 1 1 = Binary I/O = 2 2 3 It is widely regarded as a mistake that H'98 treats I/O as character-based. The proposal is that I/O should operate over octets (i.e. 8-bit binary values) instead. This would permit the layering of character-encoding conversions (see [wiki:Unicode]) over the top of the basic I/O mechanism. 3 . 4 4 5 Pros: 6 * cleans up an area of confusion 7 * backwards compatible with all implementations 5 * Character-based I/O is needed, at least because systems (e.g. Unix and Windows) have different line-termination conventions that should be hidden from programs. The problem becomes more acute when different environments use different character sets and encodings (see [wiki:Unicode]). 6 * Binary I/O is needed both to handle binary data and as a base upon which general treatment s of character-encoding conversions (see [wiki:Unicode]) may be layered. 8 7 9 Cons: 8 The proposal is to add a form of I/O over `Word8` (i.e. octets, 8-bit binary values). See the "Binary input and output" section of [http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html System.IO] for a rough design.