> > I would welcome either. However, there is a huge body of code that
> > assumes strings are lists of chars.
>
> Yes, obviously... this is for new programs (which people aren't writing
> because of Haskell's inefficiency in dealing with strings).

While I think Haskell should also support primitive random-access strings,
String as [Char] is not all that inefficient for many purposes, thanks to
laziness. After all, the world's most famous text-processing language, Perl,
represents strings as character lists too. And, I don't agree with the claim
that strings are mostly accessed in a random-access way. Anyone who needs to
be looking into the middle of a string all the time is either using the
wrong data structure, or is doing some kind of a parsing, which is usually a
linear process anyway. However, since UNIX and other applications tend to
throw around lots of structured data using strings almost exclusively, it is
still good to have array-like strings.

--FC



Reply via email to