[Haskell-cafe] Re: Strings - why [Char] is not nice

MR K P SCHUPKE k.schupke at imperial.ac.uk
Tue Sep 28 13:10:16 EDT 2004

Can this not be handled in a nicer way by the compiler? What if the
compiler tried to allocate the lists in chunks? For example when dealing
with strings, why cant the compiler allocate the string as a fixed length
unit, terminated with a link to the next unit. (IE allow the atoms in the
list to be variable size). In this way functions which return blocks of
data (for example reading a file in 8k buffers) can be treated just like
reading a normal list. This would not only save memory, but would make
IO more efficient, whilst retaining a Haskell-like style of coding.


More information about the Haskell-Cafe mailing list