[Haskell-cafe] Re: Why can't Haskell be faster?

Robin Green greenrd at greenrd.org
Wed Oct 31 10:38:28 EDT 2007

On Wed, 31 Oct 2007 14:17:13 +0000
Jules Bean <jules at jellybean.co.uk> wrote:

> Specifically, clean's uniqueness types allow for a certain kind of 
> zero-copy mutation optimisation which is much harder for a haskell 
> compiler to automatically infer. It's not clear to me that it's
> actually worth it, but I think that's the point at issue. I can
> *imagine* algorithms in which copying is actually faster than
> mutation, if copying gives you better locality.

If you want in-place update in Haskell, you can use the ST monad, or
IORefs. Yes, you have to refactor code, but anecdotally, uniqueness
types aren't without problems either - you can make one small change
and your code no longer satisfies the uniqueness condition.

More information about the Haskell-Cafe mailing list