[Haskell-cafe] Re: getting crazy with character encoding

Aaron Denney wnoise at ofb.net
Thu Sep 13 21:39:08 EDT 2007

On 2007-09-13, Stefan O'Rear <stefanor at cox.net> wrote:
> In any case, we already have hGetBuf / hPutBuf in the standard base
> libaries for raw binary IO, so code that uses getChar for bytes really
> has no excuse.

Except, of course, that hGetBuf and hPutBuf are
(a) allocating the memory for the buffers is a pain (does it require the
(b) are something of a pain to use, requiring explicitly managing what's
    valid in these buffers (though a wrapper only need be written once)
(c) while in the "standard base libraries" are not in the report or
    library report.  i.e. there's no guarantee that a conforming Haskell
    implementation will have them.  It'd be silly for an implementation to
    not support them, of course, but...

The ByteString library at least fixes (a) and (b).

Aaron Denney

More information about the Haskell-Cafe mailing list