:: (a -> a -> a) -> t a -> a package:numeric-prelude

A variant of foldr that has no base case, and thus may only be applied to non-empty structures.
foldr1 f = foldr1 f . toList
A variant of foldl that has no base case, and thus may only be applied to non-empty structures.
foldl1 f = foldl1 f . toList