Why are strings linked lists?

Mark Carroll mark at chaos.x-philes.com
Fri Nov 28 16:56:02 EST 2003


(shifting to Haskell-Cafe)

On Fri, 28 Nov 2003, Donald Bruce Stewart wrote:

> ajb:
(snip)
> > 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?

I'd be sad to lose some convenient list-based string type because I make a
lot of use of the fact that strings are lists in processing them.

> You could look at GHC's FastString representation (used internally).
> It is in $fptools/ghc/compiler/utils/FastString.lhs

It does make sense to have a rather faster form of string conveniently
available in /some/ form.

-- Mark


More information about the Haskell-Cafe mailing list