[Haskell-cafe] Re: String vs ByteString

Michael Snoyman michael at snoyman.com
Sun Aug 15 01:46:12 EDT 2010

On Sun, Aug 15, 2010 at 8:39 AM, Edward Z. Yang <ezyang at mit.edu> wrote:

> Excerpts from John Millikin's message of Sun Aug 15 01:32:51 -0400 2010:
> > Also, despite the name, ByteString and Text are for separate purposes.
> > ByteString is an efficient [Word8], Text is an efficient [Char] -- use
> > ByteString for binary data, and Text for...text. Most mature languages
> > have both types, though the choice of UTF-16 for Text is unusual.
> Given that both Python, .NET, Java and Windows use UTF-16 for their Unicode
> text representations, I cannot really agree with "unusual". :-)
> When I'm writing a web app, my code is sitting on a Linux system where the
default encoding is UTF-8, communicating with a database speaking UTF-8,
receiving request bodies in UTF-8 and sending response bodies in UTF-8. So
converting all of that data to UTF-16, just to be converted right back to
UTF-8, does seem strange for that purpose.

Remember, Python, .NET and Java are all imperative languages without
referential transparency. I doubt saying they do something some way will
influence most Haskell coders much ;).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100815/54438219/attachment.html

More information about the Haskell-Cafe mailing list