[Haskell-beginners] Space leak in a fold even after the usual fixes

Brent Yorgey byorgey at seas.upenn.edu
Mon Apr 12 17:30:34 EDT 2010


On Tue, Apr 13, 2010 at 08:40:43AM +1200, Stephen Blackheath [to Haskell-Beginners] wrote:
> 
> Another point is that the "a" in "a `seq` b" needs to be a let binding
> so it's the same "a" as you use in other places, e.g.
> 
>   let total' = total + value
>       n' = n + 1
>   in total' `seq` n' `seq` (total, n)

I assume you meant

>   ...
>   in total' `seq` n' `seq` (total', n')

?

-Brent


More information about the Beginners mailing list