IdrisDoc: Prelude.Foldable

Prelude.Foldable

interface Foldable 

The Foldable interface describes how you can iterate over the
elements in a parameterised type and combine the elements
together, using a provided function, into a single result.

foldr : Foldable t => (func : elem -> acc -> acc) -> (init : acc) -> (input : t elem) -> acc

Successively combine the elements in a parameterised type using
the provided function, starting with the element that is in the
final position i.e. the right-most position.

foldl : Foldable t => (func : acc -> elem -> acc) -> (init : acc) -> (input : t elem) -> acc

The same as foldr but begins the folding from the element at
the initial position in the data structure i.e. the left-most
position.

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

The disjunction of the collective results of applying a
predicate to all elements of a structure. all short-circuits
from left to right.

and : Foldable t => t (Lazy Bool) -> Bool

The conjunction of all elements of a structure containing
lazy boolean values. and short-circuits from left to right,
evaluating until either an element is False or no elements remain.

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

The disjunction of the collective results of applying a
predicate to all elements of a structure. any short-circuits
from left to right.

concat : Foldable t => Monoid a => t a -> a

Combine each element of a structure into a monoid

concatMap : Foldable t => Monoid m => (a -> m) -> t a -> m

Combine into a monoid the collective results of applying a function
to each element of a structure

default#foldl : Foldable t => (func : acc -> elem -> acc) -> (init : acc) -> (input : t elem) -> acc
or : Foldable t => t (Lazy Bool) -> Bool

The disjunction of all elements of a structure containing
lazy boolean values. or short-circuits from left to right, evaluating
either until an element is True or no elements remain.

product : Foldable t => Num a => t a -> a

Multiply together all elements of a structure

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

Add together all the elements of a structure