Andrew:

There is a ListLike package, which does this nice abstraction. but I don't know if it is ready for and/or enough complete for serious usage.
I´m thinking into using it for the same reasons.

Anyone has some experiences to share about it?


2012/11/10 Andrew Pennebaker <andrew.pennebaker@gmail.com>
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

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe




--
Alberto.