[Haskell-beginners] foldl' vs seq

Gabi bugspynet at gmail.com
Mon Feb 1 06:54:31 EST 2010


Hi Stephen,
Thanks for the answer. Now I got confused :)

1. What is seq used for if it doesn't force strictness ?
2. Why the accumulator is important ? In other words why the following
is much slower ? Isn't it RT too ?

slowSum :: [Integer] -> Integer
slowSum[] = 0
slowSum (x:xs) = x `seq` x + slowSum xs


More information about the Beginners mailing list