[Haskell-cafe] Program optimisation

Donald Bruce Stewart dons at cse.unsw.edu.au
Fri Apr 20 20:58:25 EDT 2007


droundy:
> In any case, in my opinion Haskell desperately needs more strict data
> types, as strict types can go a long way towards eliminating all sorts of

Yes! Haskell is a combined strict and lazy language, after all.

In particular, the ability to precisely combine strictness and laziness
in a single data structure (e.g. Data.ByteString.Lazy) leads to some
really nice applications difficult to realise in a fully strict
language.

There's a small beginnings of a 'strict' Data.* here,

    http://hackage.haskell.org/cgi-bin/hackage-scripts/package/strict-0.1

Some additions to that could be useful.

> pain.  I remember once going through all sorts of pain trying to avoid
> stack overflows when using Data.Map to compute a histogram, which all would
> have been avoided if there were a strict version of Data.Map (or even just
> strict functions on the lazy Data.Map).  I don't think eliminating all
> laziness is a good idea, but (optional) strict datatypes most certainly
> are, as they can go a very long ways towards eliminating memory leaks.

Quite so. I can imagine some useful variants of Data.Map.Strict/Lazy/...

-- Don


More information about the Haskell-Cafe mailing list