:: (a -> a -> a) -> t a -> a package:rio

A variant of foldl that has no base case, and thus may only be applied to non-empty structures.
foldl1 f = foldl1 f . toList
A variant of foldr that has no base case, and thus may only be applied to non-empty structures.
foldr1 f = foldr1 f . toList
O(n) Left fold on non-empty vectors
O(n) Left fold on non-empty vectors with strict accumulator
O(n) Right fold on non-empty vectors
O(n) Right fold on non-empty vectors with strict accumulator