Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 6e204a966e8c42d976f99a1700ce5f20 > files > 2244

ghc-7.4.2-4.mga5.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Data.Foldable</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Data-Foldable.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">base-4.5.1.0: Basic libraries</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Maintainer</th><td>libraries@haskell.org</td></tr><tr><th>Safe Haskell</th><td>Trustworthy</td></tr></table><p class="caption">Data.Foldable</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Folds
</a><ul><li><a href="#g:2">Special biased folds
</a></li><li><a href="#g:3">Folding actions
</a><ul><li><a href="#g:4">Applicative actions
</a></li><li><a href="#g:5">Monadic actions
</a></li></ul></li><li><a href="#g:6">Specialized folds
</a></li><li><a href="#g:7">Searches
</a></li></ul></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Class of data structures that can be folded to a summary value.
</p><p>Many of these functions generalize <a href="Prelude.html">Prelude</a>, <a href="Control-Monad.html">Control.Monad</a> and
 <a href="Data-List.html">Data.List</a> functions of the same names from lists to any <code><a href="Data-Foldable.html#t:Foldable">Foldable</a></code>
 functor.  To avoid ambiguity, either import those modules hiding
 these names or qualify uses of these function names with an alias
 for this module.
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">class</span>  <a href="#t:Foldable">Foldable</a> t  <span class="keyword">where</span><ul class="subs"><li><a href="#v:fold">fold</a> :: <a href="Data-Monoid.html#t:Monoid">Monoid</a> m =&gt; t m -&gt; m</li><li><a href="#v:foldMap">foldMap</a> :: <a href="Data-Monoid.html#t:Monoid">Monoid</a> m =&gt; (a -&gt; m) -&gt; t a -&gt; m</li><li><a href="#v:foldr">foldr</a> ::  (a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b</li><li><a href="#v:foldl">foldl</a> ::  (a -&gt; b -&gt; a) -&gt; a -&gt; t b -&gt; a</li><li><a href="#v:foldr1">foldr1</a> ::  (a -&gt; a -&gt; a) -&gt; t a -&gt; a</li><li><a href="#v:foldl1">foldl1</a> ::  (a -&gt; a -&gt; a) -&gt; t a -&gt; a</li></ul></li><li class="src short"><a href="#v:foldr-39-">foldr'</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; (a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b</li><li class="src short"><a href="#v:foldl-39-">foldl'</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; (a -&gt; b -&gt; a) -&gt; a -&gt; t b -&gt; a</li><li class="src short"><a href="#v:foldrM">foldrM</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Monad.html#t:Monad">Monad</a> m) =&gt; (a -&gt; b -&gt; m b) -&gt; b -&gt; t a -&gt; m b</li><li class="src short"><a href="#v:foldlM">foldlM</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Monad.html#t:Monad">Monad</a> m) =&gt; (a -&gt; b -&gt; m a) -&gt; a -&gt; t b -&gt; m a</li><li class="src short"><a href="#v:traverse_">traverse_</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Applicative.html#t:Applicative">Applicative</a> f) =&gt; (a -&gt; f b) -&gt; t a -&gt; f <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:for_">for_</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Applicative.html#t:Applicative">Applicative</a> f) =&gt; t a -&gt; (a -&gt; f b) -&gt; f <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:sequenceA_">sequenceA_</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Applicative.html#t:Applicative">Applicative</a> f) =&gt; t (f a) -&gt; f <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:asum">asum</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Applicative.html#t:Alternative">Alternative</a> f) =&gt; t (f a) -&gt; f a</li><li class="src short"><a href="#v:mapM_">mapM_</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Monad.html#t:Monad">Monad</a> m) =&gt; (a -&gt; m b) -&gt; t a -&gt; m <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:forM_">forM_</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Monad.html#t:Monad">Monad</a> m) =&gt; t a -&gt; (a -&gt; m b) -&gt; m <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:sequence_">sequence_</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Monad.html#t:Monad">Monad</a> m) =&gt; t (m a) -&gt; m <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:msum">msum</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Monad.html#t:MonadPlus">MonadPlus</a> m) =&gt; t (m a) -&gt; m a</li><li class="src short"><a href="#v:toList">toList</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; t a -&gt; [a]</li><li class="src short"><a href="#v:concat">concat</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; t [a] -&gt; [a]</li><li class="src short"><a href="#v:concatMap">concatMap</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]</li><li class="src short"><a href="#v:and">and</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; t <a href="Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:or">or</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; t <a href="Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:any">any</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; (a -&gt; <a href="Data-Bool.html#t:Bool">Bool</a>) -&gt; t a -&gt; <a href="Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:all">all</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; (a -&gt; <a href="Data-Bool.html#t:Bool">Bool</a>) -&gt; t a -&gt; <a href="Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:sum">sum</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Prelude.html#t:Num">Num</a> a) =&gt; t a -&gt; a</li><li class="src short"><a href="#v:product">product</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Prelude.html#t:Num">Num</a> a) =&gt; t a -&gt; a</li><li class="src short"><a href="#v:maximum">maximum</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Data-Ord.html#t:Ord">Ord</a> a) =&gt; t a -&gt; a</li><li class="src short"><a href="#v:maximumBy">maximumBy</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; (a -&gt; a -&gt; <a href="Data-Ord.html#t:Ordering">Ordering</a>) -&gt; t a -&gt; a</li><li class="src short"><a href="#v:minimum">minimum</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Data-Ord.html#t:Ord">Ord</a> a) =&gt; t a -&gt; a</li><li class="src short"><a href="#v:minimumBy">minimumBy</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; (a -&gt; a -&gt; <a href="Data-Ord.html#t:Ordering">Ordering</a>) -&gt; t a -&gt; a</li><li class="src short"><a href="#v:elem">elem</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Data-Eq.html#t:Eq">Eq</a> a) =&gt; a -&gt; t a -&gt; <a href="Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:notElem">notElem</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Data-Eq.html#t:Eq">Eq</a> a) =&gt; a -&gt; t a -&gt; <a href="Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:find">find</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; (a -&gt; <a href="Data-Bool.html#t:Bool">Bool</a>) -&gt; t a -&gt; <a href="Data-Maybe.html#t:Maybe">Maybe</a> a</li></ul></div><div id="interface"><h1 id="g:1">Folds
</h1><div class="top"><p class="src"><span class="keyword">class</span>  <a name="t:Foldable" class="def">Foldable</a> t  <span class="keyword">where</span></p><div class="doc"><p>Data structures that can be folded.
</p><p>Minimal complete definition: <code><a href="Data-Foldable.html#v:foldMap">foldMap</a></code> or <code><a href="Data-Foldable.html#v:foldr">foldr</a></code>.
</p><p>For example, given a data type
</p><pre> data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)
</pre><p>a suitable instance would be
</p><pre> instance Foldable Tree where
    foldMap f Empty = mempty
    foldMap f (Leaf x) = f x
    foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r
</pre><p>This is suitable even for abstract types, as the monoid is assumed
 to satisfy the monoid laws.  Alternatively, one could define <code>foldr</code>:
</p><pre> instance Foldable Tree where
    foldr f z Empty = z
    foldr f z (Leaf x) = f x z
    foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l
</pre></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:fold" class="def">fold</a> :: <a href="Data-Monoid.html#t:Monoid">Monoid</a> m =&gt; t m -&gt; m</p><div class="doc"><p>Combine the elements of a structure using a monoid.
</p></div><p class="src"><a name="v:foldMap" class="def">foldMap</a> :: <a href="Data-Monoid.html#t:Monoid">Monoid</a> m =&gt; (a -&gt; m) -&gt; t a -&gt; m</p><div class="doc"><p>Map each element of the structure to a monoid,
 and combine the results.
</p></div><p class="src"><a name="v:foldr" class="def">foldr</a> ::  (a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b</p><div class="doc"><p>Right-associative fold of a structure.
</p><pre><code><a href="Data-Foldable.html#v:foldr">foldr</a></code> f z = <code><a href="Data-List.html#v:foldr">foldr</a></code> f z . <code><a href="Data-Foldable.html#v:toList">toList</a></code></pre></div><p class="src"><a name="v:foldl" class="def">foldl</a> ::  (a -&gt; b -&gt; a) -&gt; a -&gt; t b -&gt; a</p><div class="doc"><p>Left-associative fold of a structure.
</p><pre><code><a href="Data-Foldable.html#v:foldl">foldl</a></code> f z = <code><a href="Data-List.html#v:foldl">foldl</a></code> f z . <code><a href="Data-Foldable.html#v:toList">toList</a></code></pre></div><p class="src"><a name="v:foldr1" class="def">foldr1</a> ::  (a -&gt; a -&gt; a) -&gt; t a -&gt; a</p><div class="doc"><p>A variant of <code><a href="Data-Foldable.html#v:foldr">foldr</a></code> that has no base case,
 and thus may only be applied to non-empty structures.
</p><pre><code><a href="Data-Foldable.html#v:foldr1">foldr1</a></code> f = <code><a href="Data-List.html#v:foldr1">foldr1</a></code> f . <code><a href="Data-Foldable.html#v:toList">toList</a></code></pre></div><p class="src"><a name="v:foldl1" class="def">foldl1</a> ::  (a -&gt; a -&gt; a) -&gt; t a -&gt; a</p><div class="doc"><p>A variant of <code><a href="Data-Foldable.html#v:foldl">foldl</a></code> that has no base case,
 and thus may only be applied to non-empty structures.
</p><pre><code><a href="Data-Foldable.html#v:foldl1">foldl1</a></code> f = <code><a href="Data-List.html#v:foldl1">foldl1</a></code> f . <code><a href="Data-Foldable.html#v:toList">toList</a></code></pre></div></div><div class="subs instances"><p id="control.i:Foldable" class="caption collapser" onclick="toggleSection('i:Foldable')">Instances</p><div id="section.i:Foldable" class="show"><table><tr><td class="src"><a href="Data-Foldable.html#t:Foldable">Foldable</a> []</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Data-Foldable.html#t:Foldable">Foldable</a> <a href="Data-Maybe.html#t:Maybe">Maybe</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Data-Ix.html#t:Ix">Ix</a> i =&gt; <a href="Data-Foldable.html#t:Foldable">Foldable</a> (Array i)</td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><h2 id="g:2">Special biased folds
</h2><div class="top"><p class="src"><a name="v:foldr-39-" class="def">foldr'</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; (a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b</p><div class="doc"><p>Fold over the elements of a structure,
 associating to the right, but strictly.
</p></div></div><div class="top"><p class="src"><a name="v:foldl-39-" class="def">foldl'</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; (a -&gt; b -&gt; a) -&gt; a -&gt; t b -&gt; a</p><div class="doc"><p>Fold over the elements of a structure,
 associating to the left, but strictly.
</p></div></div><div class="top"><p class="src"><a name="v:foldrM" class="def">foldrM</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Monad.html#t:Monad">Monad</a> m) =&gt; (a -&gt; b -&gt; m b) -&gt; b -&gt; t a -&gt; m b</p><div class="doc"><p>Monadic fold over the elements of a structure,
 associating to the right, i.e. from right to left.
</p></div></div><div class="top"><p class="src"><a name="v:foldlM" class="def">foldlM</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Monad.html#t:Monad">Monad</a> m) =&gt; (a -&gt; b -&gt; m a) -&gt; a -&gt; t b -&gt; m a</p><div class="doc"><p>Monadic fold over the elements of a structure,
 associating to the left, i.e. from left to right.
</p></div></div><h2 id="g:3">Folding actions
</h2><h3 id="g:4">Applicative actions
</h3><div class="top"><p class="src"><a name="v:traverse_" class="def">traverse_</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Applicative.html#t:Applicative">Applicative</a> f) =&gt; (a -&gt; f b) -&gt; t a -&gt; f <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></p><div class="doc"><p>Map each element of a structure to an action, evaluate
 these actions from left to right, and ignore the results.
</p></div></div><div class="top"><p class="src"><a name="v:for_" class="def">for_</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Applicative.html#t:Applicative">Applicative</a> f) =&gt; t a -&gt; (a -&gt; f b) -&gt; f <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></p><div class="doc"><p><code><a href="Data-Foldable.html#v:for_">for_</a></code> is <code><a href="Data-Foldable.html#v:traverse_">traverse_</a></code> with its arguments flipped.
</p></div></div><div class="top"><p class="src"><a name="v:sequenceA_" class="def">sequenceA_</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Applicative.html#t:Applicative">Applicative</a> f) =&gt; t (f a) -&gt; f <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></p><div class="doc"><p>Evaluate each action in the structure from left to right,
 and ignore the results.
</p></div></div><div class="top"><p class="src"><a name="v:asum" class="def">asum</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Applicative.html#t:Alternative">Alternative</a> f) =&gt; t (f a) -&gt; f a</p><div class="doc"><p>The sum of a collection of actions, generalizing <code><a href="Data-Foldable.html#v:concat">concat</a></code>.
</p></div></div><h3 id="g:5">Monadic actions
</h3><div class="top"><p class="src"><a name="v:mapM_" class="def">mapM_</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Monad.html#t:Monad">Monad</a> m) =&gt; (a -&gt; m b) -&gt; t a -&gt; m <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></p><div class="doc"><p>Map each element of a structure to a monadic action, evaluate
 these actions from left to right, and ignore the results.
</p></div></div><div class="top"><p class="src"><a name="v:forM_" class="def">forM_</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Monad.html#t:Monad">Monad</a> m) =&gt; t a -&gt; (a -&gt; m b) -&gt; m <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></p><div class="doc"><p><code><a href="Data-Foldable.html#v:forM_">forM_</a></code> is <code><a href="Data-Foldable.html#v:mapM_">mapM_</a></code> with its arguments flipped.
</p></div></div><div class="top"><p class="src"><a name="v:sequence_" class="def">sequence_</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Monad.html#t:Monad">Monad</a> m) =&gt; t (m a) -&gt; m <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></p><div class="doc"><p>Evaluate each monadic action in the structure from left to right,
 and ignore the results.
</p></div></div><div class="top"><p class="src"><a name="v:msum" class="def">msum</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Control-Monad.html#t:MonadPlus">MonadPlus</a> m) =&gt; t (m a) -&gt; m a</p><div class="doc"><p>The sum of a collection of actions, generalizing <code><a href="Data-Foldable.html#v:concat">concat</a></code>.
</p></div></div><h2 id="g:6">Specialized folds
</h2><div class="top"><p class="src"><a name="v:toList" class="def">toList</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; t a -&gt; [a]</p><div class="doc"><p>List of elements of a structure.
</p></div></div><div class="top"><p class="src"><a name="v:concat" class="def">concat</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; t [a] -&gt; [a]</p><div class="doc"><p>The concatenation of all the elements of a container of lists.
</p></div></div><div class="top"><p class="src"><a name="v:concatMap" class="def">concatMap</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]</p><div class="doc"><p>Map a function over all the elements of a container and concatenate
 the resulting lists.
</p></div></div><div class="top"><p class="src"><a name="v:and" class="def">and</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; t <a href="Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p><code><a href="Data-Foldable.html#v:and">and</a></code> returns the conjunction of a container of Bools.  For the
 result to be <code><a href="Data-Bool.html#v:True">True</a></code>, the container must be finite; <code><a href="Data-Bool.html#v:False">False</a></code>, however,
 results from a <code><a href="Data-Bool.html#v:False">False</a></code> value finitely far from the left end.
</p></div></div><div class="top"><p class="src"><a name="v:or" class="def">or</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; t <a href="Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p><code><a href="Data-Foldable.html#v:or">or</a></code> returns the disjunction of a container of Bools.  For the
 result to be <code><a href="Data-Bool.html#v:False">False</a></code>, the container must be finite; <code><a href="Data-Bool.html#v:True">True</a></code>, however,
 results from a <code><a href="Data-Bool.html#v:True">True</a></code> value finitely far from the left end.
</p></div></div><div class="top"><p class="src"><a name="v:any" class="def">any</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; (a -&gt; <a href="Data-Bool.html#t:Bool">Bool</a>) -&gt; t a -&gt; <a href="Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Determines whether any element of the structure satisfies the predicate.
</p></div></div><div class="top"><p class="src"><a name="v:all" class="def">all</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; (a -&gt; <a href="Data-Bool.html#t:Bool">Bool</a>) -&gt; t a -&gt; <a href="Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Determines whether all elements of the structure satisfy the predicate.
</p></div></div><div class="top"><p class="src"><a name="v:sum" class="def">sum</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Prelude.html#t:Num">Num</a> a) =&gt; t a -&gt; a</p><div class="doc"><p>The <code><a href="Data-Foldable.html#v:sum">sum</a></code> function computes the sum of the numbers of a structure.
</p></div></div><div class="top"><p class="src"><a name="v:product" class="def">product</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Prelude.html#t:Num">Num</a> a) =&gt; t a -&gt; a</p><div class="doc"><p>The <code><a href="Data-Foldable.html#v:product">product</a></code> function computes the product of the numbers of a structure.
</p></div></div><div class="top"><p class="src"><a name="v:maximum" class="def">maximum</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Data-Ord.html#t:Ord">Ord</a> a) =&gt; t a -&gt; a</p><div class="doc"><p>The largest element of a non-empty structure.
</p></div></div><div class="top"><p class="src"><a name="v:maximumBy" class="def">maximumBy</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; (a -&gt; a -&gt; <a href="Data-Ord.html#t:Ordering">Ordering</a>) -&gt; t a -&gt; a</p><div class="doc"><p>The largest element of a non-empty structure with respect to the
 given comparison function.
</p></div></div><div class="top"><p class="src"><a name="v:minimum" class="def">minimum</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Data-Ord.html#t:Ord">Ord</a> a) =&gt; t a -&gt; a</p><div class="doc"><p>The least element of a non-empty structure.
</p></div></div><div class="top"><p class="src"><a name="v:minimumBy" class="def">minimumBy</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; (a -&gt; a -&gt; <a href="Data-Ord.html#t:Ordering">Ordering</a>) -&gt; t a -&gt; a</p><div class="doc"><p>The least element of a non-empty structure with respect to the
 given comparison function.
</p></div></div><h2 id="g:7">Searches
</h2><div class="top"><p class="src"><a name="v:elem" class="def">elem</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Data-Eq.html#t:Eq">Eq</a> a) =&gt; a -&gt; t a -&gt; <a href="Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Does the element occur in the structure?
</p></div></div><div class="top"><p class="src"><a name="v:notElem" class="def">notElem</a> :: (<a href="Data-Foldable.html#t:Foldable">Foldable</a> t, <a href="Data-Eq.html#t:Eq">Eq</a> a) =&gt; a -&gt; t a -&gt; <a href="Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p><code><a href="Data-Foldable.html#v:notElem">notElem</a></code> is the negation of <code><a href="Data-Foldable.html#v:elem">elem</a></code>.
</p></div></div><div class="top"><p class="src"><a name="v:find" class="def">find</a> :: <a href="Data-Foldable.html#t:Foldable">Foldable</a> t =&gt; (a -&gt; <a href="Data-Bool.html#t:Bool">Bool</a>) -&gt; t a -&gt; <a href="Data-Maybe.html#t:Maybe">Maybe</a> a</p><div class="doc"><p>The <code><a href="Data-Foldable.html#v:find">find</a></code> function takes a predicate and a structure and returns
 the leftmost element of the structure matching the predicate, or
 <code><a href="Data-Maybe.html#v:Nothing">Nothing</a></code> if there is no such element.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.11.0</p></div></body></html>