
10 Mar
2010
10 Mar
'10
4:48 p.m.
texitoi:
After programming as an exercice the sum function, my version is faster than the Data.List's version. Looking at the source code, Data.List uses a foldl and not a foldl'. foldl' seems faster and allows to use very big lists. So, why is foldl used by Data.List for sum?
It's considered a bug in the H98 report I think (since there was no fold' at the time). If you're summing sequences, have a look at Data.Vector for faster code.