Why are strings linked lists?
Hal Daume III
hdaume at ISI.EDU
Fri Nov 28 10:21:12 EST 2003
> As a matter of pure speculation, how big an impact would it have if, in
> the next "version" of Haskell, Strings were represented as opaque types
> with appropriate functions to convert to and from [Char]? Would there be
> rioting in the streets?
For me, there would rather be celebration :), especially if these could be
tuned to only use 8 bits. I tend to try to use packed strings for most of
the stuff I do, but the one major problem I have with them is that there
is not correspondent to hGetLine. You need to know the length of the line
apriori or write your own using getting characters and concatenating them
(AFAIK). Either way, you're going to get performance hits for going
As a minor quibble, I don't like the naming scheme with packString and
unpackPS...seems very unbalanced to me :).
my 2 cents
Hal Daume III | hdaume at isi.edu
"Arrest this man, he talks in maths." | www.isi.edu/~hdaume
More information about the Haskell