
27 Sep
2012
27 Sep
'12
12:06 p.m.
On Thu, Sep 27, 2012 at 05:36:00PM +0200, Bertram Felgenhauer wrote:
But we could define
foldr1 f (x:xs) = foldr f x xs
which would be more lazy. I see no advantage to defining foldr1 as in the standard library, am I missing anything?
That doesn't have the right behaviour: Prelude> Data.List.foldr1 (-) [3,5] -2 Prelude> let foldr1 f (x:xs) = foldr f x xs in foldr1 (-) [3,5] 2 Thanks Ian