FoldA -package:pipes
Branch over a
Foldable collection of values.
The Foldable class represents data structures that can be reduced to a
summary value one element at a time. Strict left-associative folds are
a good fit for space-efficient reduction, while lazy right-associative
folds are a good fit for corecursive iteration, or for folds that
short-circuit after processing an initial subsequence of the
structure's elements.
Instances can be derived automatically by enabling the
DeriveFoldable extension. For example, a derived instance for
a binary tree might be:
{-# LANGUAGE DeriveFoldable #-}
data Tree a = Empty
| Leaf a
| Node (Tree a) a (Tree a)
deriving Foldable
A more detailed description can be found in the
Overview
section of
Data.Foldable#overview.
For the class laws see the
Laws section of
Data.Foldable#laws.
Class of data structures that can be folded to a summary value.
A class of non-empty data structures that can be folded to a summary
value.
Non-empty data structures that can be folded.
A container that supports folding with an additional index.
Re-exports a subset of the
Data.Foldable1 module along with
some additional combinators that require
Foldable1 constraints.
The Foldable class represents data structures that can be reduced to a
summary value one element at a time. Strict left-associative folds are
a good fit for space-efficient reduction, while lazy right-associative
folds are a good fit for corecursive iteration, or for folds that
short-circuit after processing an initial subsequence of the
structure's elements.
Instances can be derived automatically by enabling the
DeriveFoldable extension. For example, a derived instance for
a binary tree might be:
{-# LANGUAGE DeriveFoldable #-}
data Tree a = Empty
| Leaf a
| Node (Tree a) a (Tree a)
deriving Foldable
A more detailed description can be found in the
Overview
section of
Data.Foldable#overview.
For the class laws see the
Laws section of
Data.Foldable#laws.
Contains utility functions for working with tuples.
The class of foldable data structures that cannot be empty.
The Foldable class represents data structures that can be reduced to a
summary value one element at a time. Strict left-associative folds are
a good fit for space-efficient reduction, while lazy right-associative
folds are a good fit for corecursive iteration, or for folds that
short-circuit after processing an initial subsequence of the
structure's elements.
Instances can be derived automatically by enabling the
DeriveFoldable extension. For example, a derived instance for
a binary tree might be:
{-# LANGUAGE DeriveFoldable #-}
data Tree a = Empty
| Leaf a
| Node (Tree a) a (Tree a)
deriving Foldable
A more detailed description can be found in the
Overview
section of
Data.Foldable#overview.
For the class laws see the
Laws section of
Data.Foldable#laws.
A container that supports folding with an additional index.
A non-empty container that supports folding with an additional index.
This is the primary class for structures that are to be considered
foldable. A minimum complete definition provides
foldl and
foldr.
Instances of
FoldableLL can be folded, and can be many and
varied.
These functions are used heavily in
Data.ListLike.
Generic tools for data structures that can be folded.
Written by John Goerzen, jgoerzen@complete.org