std.foldable

Implementation of the Foldable type

Types

#[implicit]
type Foldable f = {
    foldr : forall a b . (a -> b -> b) -> b -> f a -> b,
    foldl : forall a b . (b -> a -> b) -> b -> f a -> b
}

Operations over a data structure that can be folded which means that a functions gets called on each element to reduce the structure to a single value (Array, List and Map are all Foldable)

Values

let foldr ?fold : forall f . forall a b . [Foldable f] -> (a -> b -> b) -> b -> f a -> b

let foldl ?fold : forall f . forall a b . [Foldable f] -> (b -> a -> b) -> b -> f a -> b

let fold_m ?fold ?monad f z : forall b a m t . [Foldable t] -> [Monad m] -> (a -> b -> m a) -> a -> t b -> m a

let concat : forall m t . [Foldable t] -> [Monoid m] -> t m -> m

let concat_map f : forall a m t . [Foldable t] -> [Monoid m] -> (a -> m) -> t a -> m

let find ?fold pred : forall a t . [Foldable t] -> (a -> Bool) -> t a -> Option a

let find_map ?fold pred : forall b a t . [Foldable t] -> (a -> Option b) -> t a -> Option b

let all pred : forall a t . [Foldable t] -> (a -> Bool) -> t a -> Bool

let any pred : forall a t . [Foldable t] -> (a -> Bool) -> t a -> Bool

let elem x : forall a t . [Foldable t] -> [Eq a] -> a -> t a -> Bool

let count : forall a t . [Foldable t] -> t a -> Int