Why are strings linked lists?
glynn.clements at virgin.net
Fri Nov 28 21:21:50 EST 2003
Wolfgang Jeltsch wrote:
> > > 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.
> What do you mean with this? Hopefully, not dropping Unicode support because
> this would be a very bad idea, IMHO.
What Unicode support?
Simply claiming that values of type Char are Unicode characters
doesn't make it so.
Actually supporting Unicode would require re-implementing toUpper,
toLower and the is* functions, as well as at least re-implementing the
I/O library (and, realistically, re-designing it; while you *could*
just force the use of a specific encoding, the result of doing so
would be an I/O system which was almost worthless for real use).
Right now, values of type Char are, in reality, ISO Latin-1 codepoints
padded out to 4 bytes per char.
It isn't possible to "drop" support which isn't there.
Glynn Clements <glynn.clements at virgin.net>
More information about the Haskell