I am trying out Criterion to make some quick measurements, here I compare scanl1 (+) rand with sum rand for a random list, and the former takes much less time than the latter, even though it should be more work.
If I try last . scanl1 (+) to obtain a value equal to sum rand, I get a similar time.
One point which may be unclear to me is the description of nf in Criterion.Main:
Apply an argument to a function, and evaluate the result to head normal form (NF).
I'm not sure what "head normal form" means in the context of Haskell, particularly when there are constructors, but the comments at the top of the page seem to indicate that nf would fully evaluate the list.
What am I missing?Syrak
[link] [7 comments]