[Haskell-cafe] Re: String vs ByteString

David Menendez dave at zednenem.com
Sat Aug 14 15:26:04 EDT 2010

On Fri, Aug 13, 2010 at 10:43 AM, Johan Tibell <johan.tibell at gmail.com> 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.

It's a good rule, but I don't know how helpful it is to someone doing
XML processing. From what I can tell, the only XML library that uses
Data.Text is libxml-sax, although tagsoup can probably be easily
extended to use it. HXT, HaXml, and xml all use [Char] internally.

Dave Menendez <dave at zednenem.com>

More information about the Haskell-Cafe mailing list