Why are strings linked lists?

Nicholas Nethercote njn25 at cam.ac.uk
Mon Dec 1 13:17:35 EST 2003


On Sat, 29 Nov 2003, Graham Klyne wrote:

> Following this debate, I find myself wondering if this is not something
> that might be optimized "behind the scenes" as a common case, rather than
> changing the computational model presented.

Argh, please, no!  I find this kind of implicit optimisation can be very
annoying.  If you aren't relying on good performance, and it goes a bit
faster than expected, that's great.  But if you are relying on fast
strings, you really don't want to be depending on the compiler optimising
things... because you'll spend half your time trying to work out whether
the optimisation has been applied, and if not, what change you made that
meant that the compiler couldn't do the optimisation...

N


More information about the Haskell-Cafe mailing list