[Haskell-cafe] Efficient string construction

Kevin Jardine kevinjardine at yahoo.com
Thu Jun 3 11:26:36 EDT 2010


--- On Thu, 6/3/10, Daniel Fischer <daniel.is.fischer at web.de> wrote:

> Perhaps Data.ByteString[.Lazy].UTF8 is an even better
> choice than Data.Text (depends on what you do).

I thought that I had the differences between the three libraries figured out but I guess not now from what you say.

I had thought that String was a simple but memory inefficient model, that Text was for, well text, and that bytestrings were for binary data (eg. images, audio files and applications that required a true view on each text byte).

So why is there a UTF8 implementation for bytestrings? Does that not duplicate what Text is trying to do? If so, why the duplication? When is each library more appropriate?

Kevin


      


More information about the Haskell-Cafe mailing list