As promised, ghc-pre4.00-2 makes seq much more useful than did 3.02 and
earlier. Thanks! (In fact, I like all the changes I've noticed so far).
So I need something else to whinge about.
The Library Report, (6.1.1) states:
"If the accumulating function is strict, then accumArray is strict in the
values, as well as the indices, in the association list. ..."
This could lead a naive optimist to hope that a use like
> print $ elems $ accumArray (+) 0 (0,0) (replicate 1000000 (0,1))
would display "[1000000]", needing little stack and heap. I can't imagine
accumArray (or arrays in general) being of much use in 'real' applications
if such behaviour isn't somehow attainable.
In fact, both stack and heap reqirements seem to be linear in the size of the
association list.
I notice the definition in PrelArr.lhs uses foldr over the list, so from that
alone I'd expect problems, but I'm sure there's much more to it.
What changes are needed to get acceptable behaviour when using a strict
accumulating function?
TWP