FR
importPour l'utiliser : import Data.Foldable

Data.Foldable — generic operations over any Foldable

Synopsis
foldMap : Foldable t => Monoid m => (a -> m) -> t a -> m

Map each element to a monoid and combine, left-to-right.

fold : Foldable t => Monoid m => t m -> m

Combine the elements of a foldable of monoids (fold = foldMap id).

toList : Foldable t => t a -> List a

All the elements as a list, left-to-right.

count : Foldable t => t a -> Nat

The number of elements.

sum : Foldable t => Additive a => t a -> a

Sum of the elements (0 for the empty foldable).

elem : Foldable t => Eq a => a -> t a -> Bool

Is a value an element? Stops at the first element equal to it.

any : Foldable t => (a -> Bool) -> t a -> Bool

Does any element satisfy the predicate? Stops at the first that does.

all : Foldable t => (a -> Bool) -> t a -> Bool

Do all elements satisfy the predicate? Stops at the first that does not.

maximum : Foldable t => Ord a => t a -> Maybe a

Largest element, or Nothing if empty (total).

minimum : Foldable t => Ord a => t a -> Maybe a

Smallest element, or Nothing if empty (total).