Sophie

Sophie

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

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.Function</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-Function.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>Safe</td></tr></table><p class="caption">Data.Function</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1"><a href="Prelude.html">Prelude</a> re-exports
</a></li><li><a href="#g:2">Other combinators
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Simple combinators working solely on and with functions.
</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"><a href="#v:id">id</a> ::  a -&gt; a</li><li class="src short"><a href="#v:const">const</a> ::  a -&gt; b -&gt; a</li><li class="src short"><a href="#v:.">(.)</a> ::  (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c</li><li class="src short"><a href="#v:flip">flip</a> ::  (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c</li><li class="src short"><a href="#v:-36-">($)</a> ::  (a -&gt; b) -&gt; a -&gt; b</li><li class="src short"><a href="#v:fix">fix</a> ::  (a -&gt; a) -&gt; a</li><li class="src short"><a href="#v:on">on</a> ::  (b -&gt; b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; c</li></ul></div><div id="interface"><h1 id="g:1"><a href="Prelude.html">Prelude</a> re-exports
</h1><div class="top"><p class="src"><a name="v:id" class="def">id</a> ::  a -&gt; a</p><div class="doc"><p>Identity function.
</p></div></div><div class="top"><p class="src"><a name="v:const" class="def">const</a> ::  a -&gt; b -&gt; a</p><div class="doc"><p>Constant function.
</p></div></div><div class="top"><p class="src"><a name="v:." class="def">(.)</a> ::  (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c</p><div class="doc"><p>Function composition.
</p></div></div><div class="top"><p class="src"><a name="v:flip" class="def">flip</a> ::  (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c</p><div class="doc"><p><code><code><a href="Data-Function.html#v:flip">flip</a></code> f</code> takes its (first) two arguments in the reverse order of <code>f</code>.
</p></div></div><div class="top"><p class="src"><a name="v:-36-" class="def">($)</a> ::  (a -&gt; b) -&gt; a -&gt; b</p><div class="doc"><p>Application operator.  This operator is redundant, since ordinary
 application <code>(f x)</code> means the same as <code>(f <code><a href="Data-Function.html#v:-36-">$</a></code> x)</code>. However, <code><a href="Data-Function.html#v:-36-">$</a></code> has
 low, right-associative binding precedence, so it sometimes allows
 parentheses to be omitted; for example:
</p><pre>     f $ g $ h x  =  f (g (h x))
</pre><p>It is also useful in higher-order situations, such as <code><code><a href="Data-List.html#v:map">map</a></code> (<code><a href="Data-Function.html#v:-36-">$</a></code> 0) xs</code>,
 or <code><code><a href="Data-List.html#v:zipWith">zipWith</a></code> (<code><a href="Data-Function.html#v:-36-">$</a></code>) fs xs</code>.
</p></div></div><h1 id="g:2">Other combinators
</h1><div class="top"><p class="src"><a name="v:fix" class="def">fix</a> ::  (a -&gt; a) -&gt; a</p><div class="doc"><p><code><code><a href="Data-Function.html#v:fix">fix</a></code> f</code> is the least fixed point of the function <code>f</code>,
 i.e. the least defined <code>x</code> such that <code>f x = x</code>.
</p></div></div><div class="top"><p class="src"><a name="v:on" class="def">on</a> ::  (b -&gt; b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; c</p><div class="doc"><p><code>(*) `on` f = \x y -&gt; f x * f y</code>.
</p><p>Typical usage: <code><code><a href="Data-List.html#v:sortBy">sortBy</a></code> (<code><a href="Data-Ord.html#v:compare">compare</a></code> `on` <code><a href="Data-Tuple.html#v:fst">fst</a></code>)</code>.
</p><p>Algebraic properties:
</p><ul><li> <code>(*) `on` <code><a href="Data-Function.html#v:id">id</a></code> = (*)</code> (if <code>(*) &#8713; {&#8869;, <code><a href="Data-Function.html#v:const">const</a></code> &#8869;}</code>)
</li><li><pre>((*) `on` f) `on` g = (*) `on` (f . g)</pre></li><li><pre><code><a href="Data-Function.html#v:flip">flip</a></code> on f . <code><a href="Data-Function.html#v:flip">flip</a></code> on g = <code><a href="Data-Function.html#v:flip">flip</a></code> on (g . f)</pre></li></ul></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>