[Haskell-cafe] Re: String vs ByteString

Bryan O'Sullivan bos at serpentine.com
Sun Aug 15 03:01:16 EDT 2010


On Sat, Aug 14, 2010 at 10:07 PM, Donn Cave <donn at avvanta.com> wrote:


> Am I confused about this?  It's why I can't see Text ever being
>
simply the obvious choice.  [Char] will continue to be the obvious
> choice if you want a functional data type that supports pattern
> matching etc.


Actually, with view patterns, Text is pretty nice to pattern match against:

foo (uncons -> Just (c,cs)) = "whee"

despam (prefixed "spam" -> Just suffix) = "whee" `mappend` suffix

ByteString will continue to be the obvious choice
> for big data loads.


Don't confuse "I have big data" with "I need bytes". If you are working with
bytes, use bytestring. If you are working with text, outside of a few narrow
domains you should use text.

 We'll have a three way choice between programming
> elegance, correctness and efficiency.  If Haskell were more than
> just a research language, this might be its most prominent open
> sore, don't you think?


No, that's just FUD.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100815/926cebd8/attachment.html


More information about the Haskell-Cafe mailing list