Compiled: Wed Dec 05 00:09:39 PST 2012 from source file: ./frege/control/Foldable.fr
Contributed by Daniel Gronau
Data structures that can be folded. Minimal complete definition: foldMap or foldr. Implementing foldl is recommended.
Combine the elements of a structure using a monoid.
A variant of fold that has no base case, and thus may only be applied to non-empty structures.
(not in Haskell's Foldable, because they have no Semigroup)
Map each element of the structure to a monoid, and combine the results.
A variant of foldMap that has no base case, and thus may only be applied to non-empty structures.
(not in Haskell's Foldable, because they have no Semigroup)
Left-associative fold of a structure.
A variant of foldl that has no base case, and thus may only be applied to non-empty structures.
Right-associative fold of a structure.
A variant of foldr that has no base case, and thus may only be applied to non-empty structures.
inherited from Foldable.fold
inherited from Foldable.fold1
inherited from Foldable.foldMap
inherited from Foldable.foldMap1
inherited from Foldable.foldl1
inherited from Foldable.foldr1
inherited from Foldable.fold
inherited from Foldable.fold1
inherited from Foldable.foldMap
inherited from Foldable.foldMap1
inherited from Foldable.foldl1
inherited from Foldable.foldr1
Determines whether all elements of the structure satisfy the predicate.
and returns the conjunction of a container of Bools. For the result to be true, the container must be finite; false, however, results from a false value finitely far from the left end.
Determines whether any element of the structure satisfies the predicate.
The concatenation of all the elements of a container of lists.
Map a function over all the elements of a container and concatenate the resulting lists.
Does the element occur in the structure?
The find function takes a predicate and a structure and returns the leftmost element of the structure matching the predicate, or Maybe.Nothing if there is no such element.
Map each element of the structure to a monoid, and combine the results.
Combine the elements of a structure using a monoid.
Fold over the elements of a structure, associating to the left, but strictly.
A variant of foldl that has no base case, and thus may only be applied to non-empty structures.
Monadic fold over the elements of a structure, associating to the left, i.e. from left to right.
Fold over the elements of a structure, associating to the right, but strictly.
A variant of foldr that has no base case, and thus may only be applied to non-empty structures.
Monadic fold over the elements of a structure, associating to the right, i.e. from right to left.
Map each element of a structure to a monadic action, evaluate these actions from left to right, and ignore the results.
The largest element of a non-empty structure.
The largest element of a non-empty structure with respect to the given comparison function.
The least element of a non-empty structure.
The least element of a non-empty structure with respect to the given comparison function.
The sum of a collection of actions, generalizing concat.
or returns the disjunction of a container of Bools. For the result to be false, the container must be finite; true, however, results from a true value finitely far from the left end.
The product function computes the product of the numbers of a structure.
Evaluate each action in the structure from left to right, and ignore the results.
Evaluate each monadic action in the structure from left to right, and ignore the results.
The sum function computes the sum of the numbers of a structure.
Map each element of a structure to an action, evaluate these actions from left to right, and ignore the results.