Why are strings linked lists?

ajb at spamcop.net ajb at spamcop.net
Thu Nov 27 22:54:11 EST 2003


G'day all.

Quoting Ben Escoto <bescoto at stanford.edu>:

> Hi, can someone tell me why Haskell strings are linked lists?

Because that's the way it was done in Miranda, almost 20 years ago.

OK, to be fair, it does make string-to-string operations a bit more
convenient.  Apart from undergraduate homework exercises and some
specific domains, though, this isn't exactly the "common case" of
all situations where people want strings.

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?

Cheers,
Andrew Bromage


More information about the Haskell mailing list