add utf8-string in haskell platform

Bryan O'Sullivan bos at
Mon May 18 13:49:28 EDT 2009

On Fri, May 15, 2009 at 4:02 AM, Simon Marlow <marlowsd at> wrote:

> We ought to think about the interaction between text (and bytestring) and
> the new Unicode IO library.  What does text have in the way of IO
> operations?

Nothing. It has pure functions for transcoding to/from ByteString. Those
functions aren't general enough, since they throw errors if an encoding
problem is encountered. We'll need to provide alternatives that require an
error handler as a parameter, so that you can do nothing, throw an error, or
provide a substitution character instead.

> I've been wondering about what bytestring's hGetLine should do.  Right now
> I have it doing decoding and then taking the low 8 bits, but that's not
> right.  OTOH, looking for '\n' in a stream of bytes doesn't seem right.
>  Maybe it should just be deprecated.

It should be deprecated once there's something sensible to replace it with.
Note that "something sensible" isn't necessarily straightforward; Unicode
specifies 7 different code point sequences as newline equivalents (LF, CR,
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Libraries mailing list