[Haskell-cafe] Bytestrings and [Char]

Mads Lindstrøm mads_lindstroem at yahoo.dk
Mon Mar 22 17:42:36 EDT 2010


Hi

David Leimbach wrote:
> 
> 
> On Mon, Mar 22, 2010 at 6:10 AM, Johan Tibell <johan.tibell at gmail.com>
> 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.
> 
> 
> Slight correction.
> 
> 
> A sequence of bytes is exactly the same thing as a sequence of Unicode
> bytes when you use UTF8.  

And a sequence of bytes is exactly the same thing as a UTF-32 string,
when the sequence is encoded as UTF-32.

But that is not the point. The point is that when some function is
handed a ByteString, the ByteString can be encoded in many ways. It do
not even have to be text.

So you need a UTF-8 String type.

/Mads

> 
> 
>  
>         
>         -- Johan
>         
>         _______________________________________________
>         Haskell-Cafe mailing list
>         Haskell-Cafe at haskell.org
>         http://www.haskell.org/mailman/listinfo/haskell-cafe
>         
> 
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20100322/d9fdcb80/attachment.bin


More information about the Haskell-Cafe mailing list