Sophie

Sophie

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

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.Either</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-Either.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.Either</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>The Either type, and associated operations.
</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">data</span>  <a href="#t:Either">Either</a> a b<ul class="subs"><li>= <a href="#v:Left">Left</a> a  </li><li>| <a href="#v:Right">Right</a> b  </li></ul></li><li class="src short"><a href="#v:either">either</a> ::  (a -&gt; c) -&gt; (b -&gt; c) -&gt; <a href="Data-Either.html#t:Either">Either</a> a b -&gt; c</li><li class="src short"><a href="#v:lefts">lefts</a> ::  [<a href="Data-Either.html#t:Either">Either</a> a b] -&gt; [a]</li><li class="src short"><a href="#v:rights">rights</a> ::  [<a href="Data-Either.html#t:Either">Either</a> a b] -&gt; [b]</li><li class="src short"><a href="#v:partitionEithers">partitionEithers</a> ::  [<a href="Data-Either.html#t:Either">Either</a> a b] -&gt; ([a], [b])</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:Either" class="def">Either</a> a b </p><div class="doc"><p>The <code><a href="Data-Either.html#t:Either">Either</a></code> type represents values with two possibilities: a value of
type <code><code><a href="Data-Either.html#t:Either">Either</a></code> a b</code> is either <code><code><a href="Data-Either.html#v:Left">Left</a></code> a</code> or <code><code><a href="Data-Either.html#v:Right">Right</a></code> b</code>.
</p><p>The <code><a href="Data-Either.html#t:Either">Either</a></code> type is sometimes used to represent a value which is
either correct or an error; by convention, the <code><a href="Data-Either.html#v:Left">Left</a></code> constructor is
used to hold an error value and the <code><a href="Data-Either.html#v:Right">Right</a></code> constructor is used to
hold a correct value (mnemonic: &quot;right&quot; also means &quot;correct&quot;).
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Left" class="def">Left</a> a</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:Right" class="def">Right</a> b</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:Either" class="caption collapser" onclick="toggleSection('i:Either')">Instances</p><div id="section.i:Either" class="show"><table><tr><td class="src"><a href="Data-Typeable-Internal.html#t:Typeable2">Typeable2</a> <a href="Data-Either.html#t:Either">Either</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Control-Monad.html#t:Monad">Monad</a> (<a href="Data-Either.html#t:Either">Either</a> e)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Control-Monad.html#t:Functor">Functor</a> (<a href="Data-Either.html#t:Either">Either</a> a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Control-Monad-Fix.html#t:MonadFix">MonadFix</a> (<a href="Data-Either.html#t:Either">Either</a> e)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Control-Applicative.html#t:Applicative">Applicative</a> (<a href="Data-Either.html#t:Either">Either</a> e)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="Data-Eq.html#t:Eq">Eq</a> a, <a href="Data-Eq.html#t:Eq">Eq</a> b) =&gt; <a href="Data-Eq.html#t:Eq">Eq</a> (<a href="Data-Either.html#t:Either">Either</a> a b)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="Data-Data.html#t:Data">Data</a> a, <a href="Data-Data.html#t:Data">Data</a> b) =&gt; <a href="Data-Data.html#t:Data">Data</a> (<a href="Data-Either.html#t:Either">Either</a> a b)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="Data-Ord.html#t:Ord">Ord</a> a, <a href="Data-Ord.html#t:Ord">Ord</a> b) =&gt; <a href="Data-Ord.html#t:Ord">Ord</a> (<a href="Data-Either.html#t:Either">Either</a> a b)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="Text-Read.html#t:Read">Read</a> a, <a href="Text-Read.html#t:Read">Read</a> b) =&gt; <a href="Text-Read.html#t:Read">Read</a> (<a href="Data-Either.html#t:Either">Either</a> a b)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="Text-Show.html#t:Show">Show</a> a, <a href="Text-Show.html#t:Show">Show</a> b) =&gt; <a href="Text-Show.html#t:Show">Show</a> (<a href="Data-Either.html#t:Either">Either</a> a b)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="../ghc-prim-0.2.0.0/GHC-Generics.html#t:Generic">Generic</a> (<a href="Data-Either.html#t:Either">Either</a> a b)</td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:either" class="def">either</a> ::  (a -&gt; c) -&gt; (b -&gt; c) -&gt; <a href="Data-Either.html#t:Either">Either</a> a b -&gt; c</p><div class="doc"><p>Case analysis for the <code><a href="Data-Either.html#t:Either">Either</a></code> type.
 If the value is <code><code><a href="Data-Either.html#v:Left">Left</a></code> a</code>, apply the first function to <code>a</code>;
 if it is <code><code><a href="Data-Either.html#v:Right">Right</a></code> b</code>, apply the second function to <code>b</code>.
</p></div></div><div class="top"><p class="src"><a name="v:lefts" class="def">lefts</a> ::  [<a href="Data-Either.html#t:Either">Either</a> a b] -&gt; [a]</p><div class="doc"><p>Extracts from a list of <code><a href="Data-Either.html#t:Either">Either</a></code> all the <code><a href="Data-Either.html#v:Left">Left</a></code> elements
 All the <code><a href="Data-Either.html#v:Left">Left</a></code> elements are extracted in order.
</p></div></div><div class="top"><p class="src"><a name="v:rights" class="def">rights</a> ::  [<a href="Data-Either.html#t:Either">Either</a> a b] -&gt; [b]</p><div class="doc"><p>Extracts from a list of <code><a href="Data-Either.html#t:Either">Either</a></code> all the <code><a href="Data-Either.html#v:Right">Right</a></code> elements
 All the <code><a href="Data-Either.html#v:Right">Right</a></code> elements are extracted in order.
</p></div></div><div class="top"><p class="src"><a name="v:partitionEithers" class="def">partitionEithers</a> ::  [<a href="Data-Either.html#t:Either">Either</a> a b] -&gt; ([a], [b])</p><div class="doc"><p>Partitions a list of <code><a href="Data-Either.html#t:Either">Either</a></code> into two lists
 All the <code><a href="Data-Either.html#v:Left">Left</a></code> elements are extracted, in order, to the first
 component of the output.  Similarly the <code><a href="Data-Either.html#v:Right">Right</a></code> elements are extracted
 to the second component of the output.
</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>