[Haskell-cafe] Re: String vs ByteString
leather at cs.uu.nl
Fri Aug 13 11:27:32 EDT 2010
Johan Tibell wrote:
> Here's a rule of thumb: If you have binary data, use Data.ByteString. If
> you have text, use Data.Text. Those libraries have benchmarks and have been
> well tuned by experienced Haskelleres and should be the fastest and most
> memory compact in most cases. There are still a few cases where String beats
> Text but they are being worked on as we speak.
Which one do you use for strings in HTML or XML in which UTF-8 has become
the commonly accepted standard encoding? It's text, not binary, so I should
choose Data.Text. But isn't there a performance penalty for translating from
Data.Text's internal 16-bit encoding to UTF-8?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe