[Haskell-cafe] Motion to unify all the string data types
Andrew Pennebaker
andrew.pennebaker at gmail.com
Sat Nov 10 03:15:08 CET 2012
Frequently when I'm coding in Haskell, the crux of my problem is converting
between all the stupid string formats.
You've got String, ByteString, Lazy ByteString, Text, [Word], and on and
on... I have to constantly lookup how to convert between them, and the
overloaded strings GHC directive doesn't work, and sometimes
ByteString.unpack doesn't work, because it expects [Word8], not [Char].
AAAAAAAAAAAAAAAAAAAH!!!
Haskell is a wonderful playground for experimentation. I've started to
notice that many Hackage libraries are simply instances of typeclasses
designed a while ago, and their underlying implementations are free to play
around with various optimizations... But they ideally all expose the same
interface through typeclasses.
Can we do the same with String? Can we pick a good compromise of lazy vs
strict, flexible vs fast, and all use the same data structure? My vote is
for type String = [Char], but I'm willing to switch to another data
structure, just as long as it's consistently used.
--
Cheers,
Andrew Pennebaker
www.yellosoft.us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121109/b4185a4b/attachment.htm>
More information about the Haskell-Cafe
mailing list