Sophie

Sophie

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

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.Ratio</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-Ratio.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>stable</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.Ratio</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Standard functions on rational numbers
</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:Ratio">Ratio</a> a</li><li class="src short"><span class="keyword">type</span> <a href="#t:Rational">Rational</a> = <a href="Data-Ratio.html#t:Ratio">Ratio</a> <a href="Prelude.html#t:Integer">Integer</a></li><li class="src short"><a href="#v:-37-">(%)</a> :: <a href="Prelude.html#t:Integral">Integral</a> a =&gt; a -&gt; a -&gt; <a href="Data-Ratio.html#t:Ratio">Ratio</a> a</li><li class="src short"><a href="#v:numerator">numerator</a> :: <a href="Prelude.html#t:Integral">Integral</a> a =&gt; <a href="Data-Ratio.html#t:Ratio">Ratio</a> a -&gt; a</li><li class="src short"><a href="#v:denominator">denominator</a> :: <a href="Prelude.html#t:Integral">Integral</a> a =&gt; <a href="Data-Ratio.html#t:Ratio">Ratio</a> a -&gt; a</li><li class="src short"><a href="#v:approxRational">approxRational</a> :: <a href="Prelude.html#t:RealFrac">RealFrac</a> a =&gt; a -&gt; a -&gt; <a href="Data-Ratio.html#t:Rational">Rational</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:Ratio" class="def">Ratio</a> a </p><div class="doc"><p>Rational numbers, with numerator and denominator of some <code><a href="Prelude.html#t:Integral">Integral</a></code> type.
</p></div><div class="subs instances"><p id="control.i:Ratio" class="caption collapser" onclick="toggleSection('i:Ratio')">Instances</p><div id="section.i:Ratio" class="show"><table><tr><td class="src"><a href="Data-Typeable-Internal.html#t:Typeable1">Typeable1</a> <a href="Data-Ratio.html#t:Ratio">Ratio</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> a =&gt; <a href="Prelude.html#t:Enum">Enum</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Data-Eq.html#t:Eq">Eq</a> a =&gt; <a href="Data-Eq.html#t:Eq">Eq</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> a =&gt; <a href="Prelude.html#t:Fractional">Fractional</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="Data-Data.html#t:Data">Data</a> a, <a href="Prelude.html#t:Integral">Integral</a> a) =&gt; <a href="Data-Data.html#t:Data">Data</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> a =&gt; <a href="Prelude.html#t:Num">Num</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> a =&gt; <a href="Data-Ord.html#t:Ord">Ord</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="Prelude.html#t:Integral">Integral</a> a, <a href="Text-Read.html#t:Read">Read</a> a) =&gt; <a href="Text-Read.html#t:Read">Read</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> a =&gt; <a href="Prelude.html#t:Real">Real</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> a =&gt; <a href="Prelude.html#t:RealFrac">RealFrac</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="Prelude.html#t:Integral">Integral</a> a, <a href="Text-Show.html#t:Show">Show</a> a) =&gt; <a href="Text-Show.html#t:Show">Show</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Rational" class="def">Rational</a> = <a href="Data-Ratio.html#t:Ratio">Ratio</a> <a href="Prelude.html#t:Integer">Integer</a></p><div class="doc"><p>Arbitrary-precision rational numbers, represented as a ratio of
 two <code><a href="Prelude.html#t:Integer">Integer</a></code> values.  A rational number may be constructed using
 the <code><a href="Data-Ratio.html#v:-37-">%</a></code> operator.
</p></div></div><div class="top"><p class="src"><a name="v:-37-" class="def">(%)</a> :: <a href="Prelude.html#t:Integral">Integral</a> a =&gt; a -&gt; a -&gt; <a href="Data-Ratio.html#t:Ratio">Ratio</a> a</p><div class="doc"><p>Forms the ratio of two integral numbers.
</p></div></div><div class="top"><p class="src"><a name="v:numerator" class="def">numerator</a> :: <a href="Prelude.html#t:Integral">Integral</a> a =&gt; <a href="Data-Ratio.html#t:Ratio">Ratio</a> a -&gt; a</p><div class="doc"><p>Extract the numerator of the ratio in reduced form:
 the numerator and denominator have no common factor and the denominator
 is positive.
</p></div></div><div class="top"><p class="src"><a name="v:denominator" class="def">denominator</a> :: <a href="Prelude.html#t:Integral">Integral</a> a =&gt; <a href="Data-Ratio.html#t:Ratio">Ratio</a> a -&gt; a</p><div class="doc"><p>Extract the denominator of the ratio in reduced form:
 the numerator and denominator have no common factor and the denominator
 is positive.
</p></div></div><div class="top"><p class="src"><a name="v:approxRational" class="def">approxRational</a> :: <a href="Prelude.html#t:RealFrac">RealFrac</a> a =&gt; a -&gt; a -&gt; <a href="Data-Ratio.html#t:Rational">Rational</a></p><div class="doc"><p><code><a href="Data-Ratio.html#v:approxRational">approxRational</a></code>, applied to two real fractional numbers <code>x</code> and <code>epsilon</code>,
 returns the simplest rational number within <code>epsilon</code> of <code>x</code>.
 A rational number <code>y</code> is said to be <em>simpler</em> than another <code>y'</code> if
</p><ul><li> <code><code><a href="Prelude.html#v:abs">abs</a></code> (<code><a href="Data-Ratio.html#v:numerator">numerator</a></code> y) &lt;= <code><a href="Prelude.html#v:abs">abs</a></code> (<code><a href="Data-Ratio.html#v:numerator">numerator</a></code> y')</code>, and
</li><li> <code><code><a href="Data-Ratio.html#v:denominator">denominator</a></code> y &lt;= <code><a href="Data-Ratio.html#v:denominator">denominator</a></code> y'</code>.
</li></ul><p>Any real interval contains a unique simplest rational;
 in particular, note that <code>0/1</code> is the simplest rational of all.
</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>