[Haskell-cafe] The Proliferation of List-Like Types

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Thu Feb 21 18:34:15 EST 2008


On Thu, 2008-02-21 at 13:34 +0100, Henning Thielemann wrote:

> I suppose we mean the same. My question is: Why do we use ByteString
> instead of [Word8] ? Entirely because of efficiency, right? So if we could
> stick to List code and only convert to ByteString at the end and the
> compiler all rewrites it to ByteString code, then we would not need
> libraries that are specialised to ByteString, but they can use [Word8]
> instead.

Yeah if we could do that it'd be great. I've suggested similar things as
extensions of our work on streams. If we know the list is being used
fully strictly then we could have replaced it with a stricter data
structure.

Even if we could do that I'm not sure we'll ever get to the situation
where it's fully automatic because some operations on array like things
are slower than lists, like consing, so even if we discover that we're
using our lists strictly it does not follow that we could get any
benefit from converting to arrays.

I think we'll be stuck with separate list and stricter array types for
some time to come.

Duncan



More information about the Haskell-Cafe mailing list