laziness again...

Ketil Z. Malde
19 Feb 2002 08:49:10 +0100

Jay Cox <> writes:

>>>         where ins i = manipulates the first element of the list

> if you mean that (ins i) :: [a] -> [a] manipulates the first element of
> the list it takes then of course it is strict.  because in

It is strict in the head of the list, yes.  I.e. it is defined as

        ...where ins i ((_,x):xs) = (i,x):xs

Apologies for being unprecise.

> PS: deepseq was mentioned earlier in either this list or the other main
> Haskell list.  I believe it was actually a DeepSeq module of some sort.

After some heap profiling (which produces marvellous plots, but is
very expensive in running time.  My tests that normally (without
profiling, or just -p) run in a couple of minutes took over an hour.
Also, the graphs indicate quite a bit less than top, but I ascribe
that to the RTS and garbage-collectables lying around), I'm starting
to suspect I'm generating a lot of unevaluated thunks.  

Is there any good tutorial or other material dealing with, and
improving (memory) performance by, strictness in Haskell?

If I haven't seen further, it is by standing in the footprints of giants