[Haskell-cafe] Bytestrings and [Char]
johann.hoechtl at gmail.com
Tue Mar 23 03:27:52 EDT 2010
On 22.03.2010 14:10, Johan Tibell wrote:
> On Mon, Mar 22, 2010 at 1:16 PM, Johann Höchtl<johann.hoechtl at gmail.com> wrote:
>> My question or discussion point: Why not depreciate [Char] altogether
>> and favour of lazy Bytestrings?
> A sequence of bytes is not the same thing as a sequence of Unicode
> code points. If you want to replace String by something more efficient
> have a look at Data.Text.
How are ByteStrings (Lazy, UTF8) and Data.Text meant to co-exist? When I read bytestrings over a socket which happens to be UTF16-LE encoded and identify a fitting function in Data.Text, I guess I have to transcode them with Data.Text.Encoding to make the type System happy?
> -- Johan
More information about the Haskell-Cafe