| ... | ... | @@ -2,17 +2,13 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 [Unicode](unicode)) over the top of the basic I/O mechanism.
|
|
|
|
Haskell 98 treats I/O as character-based, and lacks a mechanism for binary I/O. It is currently impossible to read or write binary data in a portable manner.
|
|
|
|
|
|
|
|
|
|
|
|
- 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 [Unicode](unicode)).
|
|
|
|
- Binary I/O is needed both to handle binary data and as a base upon which general treatment s of character-encoding conversions (see [Unicode](unicode)) may be layered.
|
|
|
|
|
|
|
|
Pros:
|
|
|
|
|
|
|
|
|
|
|
|
- cleans up an area of confusion
|
|
|
|
- backwards compatible with all implementations
|
|
|
|
|
|
|
|
|
|
|
|
Cons:
|
|
|
|
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 [ System.IO](http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html) for a rough design.
|
|
|
|
|
|
|
|
|