Changes between Version 1 and Version 2 of BinaryIO


Ignore:
Timestamp:
Dec 3, 2005 11:25:32 AM (8 years ago)
Author:
ross@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BinaryIO

    v1 v2  
    11= Binary I/O = 
    22 
    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. 
     3Haskell 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. 
    44 
    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. 
    87 
    9 Cons: 
     8The 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.