
The driver of my algorithm looks like this: foldl' processfn nullarray (take arg infinitelist) where processfn takes an array and the next set of inputs, processes, and delivers a new updated array (using the Data.Vector library). Apparently, I have a space leak ... the "maximum residency" varies linearly with the size of "arg" supplied, garbage collection consumes ~75% of CPU time, and, if the arg is too big, the whole thing crashes with an out of memory error. The algorithm should operate in constant space. As you can see, I'm using a strict left-fold and also have made the accumulating array strict in the processfn definition with a bang pattern. So, I'm sort of at a loss as to how to resolve this. The help provided on this list has been outstanding, thanks to all of you; hope you have something left in the tank for this one!