Changes between Version 22 and Version 23 of SplitBase


Ignore:
Timestamp:
Mar 12, 2013 3:18:24 PM (13 months ago)
Author:
tibbe
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SplitBase

    v22 v23  
    2323==== (G4) More appropriate string types in IO ==== 
    2424 
    25 Johan would like to have text Handles use the Text type and binary Handles use the !ByteString type. Right now we have this somewhat awkward setup where the I/O APIs are spread out and bundled with pure types. Splitting base would let us fix this and write a better I/O layer. 
     25We would like to be able to use the Text and !ByteString types in the I/O layer. For example, we'd like to have: 
    2626 
    27 '''SPJ''': I don't understand either the problem or the solution. 
     27{{{ 
     28module System.IO where 
     29 
     30read :: Handle -> Int -> IO ByteString 
     31write :: Handle -> ByteString -> IO () 
     32}}} 
     33 
     34but since `System.IO` is defined in base it cannot depend on e.g. bytestring and thus we cannot write these functions. At the moment we have to use `String` for all I/O which is both slow, due to its cache-inefficient nature, and incorrect, as `String` is not a representation of a sequence of bytes (but rather a sequence of Unicode code points). 
     35 
     36Splitting base would let us fix this and write a better I/O layer. 
    2837 
    2938==== (G5) Avoid code copies ====