&gt; hold a part of the data in memory while you show the first one,<br><br>Here would be a better example then. <br><br>&nbsp;&nbsp;&nbsp; f lst = show (sum (filter (&gt; 1) lst), sum (filter (&gt; 2) lst))<br><br>It ought to be *possible* to compute both operations without holding onto any of the list elements.&nbsp; 
<br><br>In the imperative world, you'd say:<br>&nbsp;&nbsp;&nbsp; sum1 = 0<br>&nbsp;&nbsp;&nbsp; sum2 = 0<br>&nbsp;&nbsp;&nbsp; for num in lst<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sum1 += num if num &gt; 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sum2 += num if num &gt; 2<br>&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; puts sum1, sum2<br><br>One could probably hack it together with foldM, the State monad, and maybe some strictness, but I'd like to make full use of laziness and stick to the basic list operations if it at all possible.
<br><br>I'm not so concerned with solving this particular problem as I am in learning the purely functional technique for performing orthogonal computations on the same input without introducing a space leak.<br><br>Maybe something like this?
<br>&nbsp;&nbsp;&nbsp; arr (sum . filter (&gt;1)) &amp;&amp;&amp; arr (sum . filter (&gt;2))<br><br>Thanks,<br>Greg<br><br>