<!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>Prelude</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_Prelude.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.3.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></table><p class="caption">Prelude</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Standard types, classes and related functions </a><ul><li><a href="#g:2">Basic data types </a><ul><li><a href="#g:3">Tuples </a></li></ul></li><li><a href="#g:4">Basic type classes </a></li><li><a href="#g:5">Numbers </a><ul><li><a href="#g:6">Numeric types </a></li><li><a href="#g:7">Numeric type classes </a></li><li><a href="#g:8">Numeric functions </a></li></ul></li><li><a href="#g:9">Monads and functors </a></li><li><a href="#g:10">Miscellaneous functions </a></li></ul></li><li><a href="#g:11">List operations </a><ul><li><a href="#g:12">Reducing lists (folds) </a><ul><li><a href="#g:13">Special folds </a></li></ul></li><li><a href="#g:14">Building lists </a><ul><li><a href="#g:15">Scans </a></li><li><a href="#g:16">Infinite lists </a></li></ul></li><li><a href="#g:17">Sublists </a></li><li><a href="#g:18">Searching lists </a></li><li><a href="#g:19">Zipping and unzipping lists </a></li><li><a href="#g:20">Functions on strings </a></li></ul></li><li><a href="#g:21">Converting to and from <code>String</code> </a><ul><li><a href="#g:22">Converting to <code>String</code> </a></li><li><a href="#g:23">Converting from <code>String</code> </a></li></ul></li><li><a href="#g:24">Basic Input and output </a><ul><li><a href="#g:25">Simple I/O operations </a><ul><li><a href="#g:26">Output functions </a></li><li><a href="#g:27">Input functions </a></li><li><a href="#g:28">Files </a></li></ul></li><li><a href="#g:29">Exception handling in the I/O monad </a></li></ul></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>The Prelude: a standard module imported by default into all Haskell modules. For more documentation, see the Haskell 98 Report <a href="http://www.haskell.org/onlinereport/">http://www.haskell.org/onlinereport/</a>. </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:Bool">Bool</a> <ul class="subs"><li>= <a href="#v:False">False</a> </li><li>| <a href="#v:True">True</a> </li></ul></li><li class="src short"><a href="#v:-38--38-">(&&)</a> :: <a href="Prelude.html#t:Bool">Bool</a> -> <a href="Prelude.html#t:Bool">Bool</a> -> <a href="Prelude.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:-124--124-">(||)</a> :: <a href="Prelude.html#t:Bool">Bool</a> -> <a href="Prelude.html#t:Bool">Bool</a> -> <a href="Prelude.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:not">not</a> :: <a href="Prelude.html#t:Bool">Bool</a> -> <a href="Prelude.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:otherwise">otherwise</a> :: <a href="Prelude.html#t:Bool">Bool</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Maybe">Maybe</a> a<ul class="subs"><li>= <a href="#v:Nothing">Nothing</a> </li><li>| <a href="#v:Just">Just</a> a </li></ul></li><li class="src short"><a href="#v:maybe">maybe</a> :: b -> (a -> b) -> <a href="Prelude.html#t:Maybe">Maybe</a> a -> b</li><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 -> c) -> (b -> c) -> <a href="Prelude.html#t:Either">Either</a> a b -> c</li><li class="src short"><span class="keyword">data</span> <a href="#t:Ordering">Ordering</a> <ul class="subs"><li>= <a href="#v:LT">LT</a> </li><li>| <a href="#v:EQ">EQ</a> </li><li>| <a href="#v:GT">GT</a> </li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:Char">Char</a> </li><li class="src short"><span class="keyword">type</span> <a href="#t:String">String</a> = [<a href="Prelude.html#t:Char">Char</a>]</li><li class="src short"><a href="#v:fst">fst</a> :: (a, b) -> a</li><li class="src short"><a href="#v:snd">snd</a> :: (a, b) -> b</li><li class="src short"><a href="#v:curry">curry</a> :: ((a, b) -> c) -> a -> b -> c</li><li class="src short"><a href="#v:uncurry">uncurry</a> :: (a -> b -> c) -> (a, b) -> c</li><li class="src short"><span class="keyword">class</span> <a href="#t:Eq">Eq</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:-61--61-">(==)</a> :: a -> a -> <a href="Prelude.html#t:Bool">Bool</a></li><li><a href="#v:-47--61-">(/=)</a> :: a -> a -> <a href="Prelude.html#t:Bool">Bool</a></li></ul></li><li class="src short"><span class="keyword">class</span> <a href="Prelude.html#t:Eq">Eq</a> a => <a href="#t:Ord">Ord</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:compare">compare</a> :: a -> a -> <a href="Prelude.html#t:Ordering">Ordering</a></li><li><a href="#v:-60-">(<)</a> :: a -> a -> <a href="Prelude.html#t:Bool">Bool</a></li><li><a href="#v:-62--61-">(>=)</a> :: a -> a -> <a href="Prelude.html#t:Bool">Bool</a></li><li><a href="#v:-62-">(>)</a> :: a -> a -> <a href="Prelude.html#t:Bool">Bool</a></li><li><a href="#v:-60--61-">(<=)</a> :: a -> a -> <a href="Prelude.html#t:Bool">Bool</a></li><li><a href="#v:max">max</a> :: a -> a -> a</li><li><a href="#v:min">min</a> :: a -> a -> a</li></ul></li><li class="src short"><span class="keyword">class</span> <a href="#t:Enum">Enum</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:succ">succ</a> :: a -> a</li><li><a href="#v:pred">pred</a> :: a -> a</li><li><a href="#v:toEnum">toEnum</a> :: <a href="Prelude.html#t:Int">Int</a> -> a</li><li><a href="#v:fromEnum">fromEnum</a> :: a -> <a href="Prelude.html#t:Int">Int</a></li><li><a href="#v:enumFrom">enumFrom</a> :: a -> [a]</li><li><a href="#v:enumFromThen">enumFromThen</a> :: a -> a -> [a]</li><li><a href="#v:enumFromTo">enumFromTo</a> :: a -> a -> [a]</li><li><a href="#v:enumFromThenTo">enumFromThenTo</a> :: a -> a -> a -> [a]</li></ul></li><li class="src short"><span class="keyword">class</span> <a href="#t:Bounded">Bounded</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:minBound">minBound</a> :: a</li><li><a href="#v:maxBound">maxBound</a> :: a</li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:Int">Int</a> </li><li class="src short"><span class="keyword">data</span> <a href="#t:Integer">Integer</a> </li><li class="src short"><span class="keyword">data</span> <a href="#t:Float">Float</a> </li><li class="src short"><span class="keyword">data</span> <a href="#t:Double">Double</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"><span class="keyword">class</span> (<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Show">Show</a> a) => <a href="#t:Num">Num</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:-43-">(+)</a> :: a -> a -> a</li><li><a href="#v:-42-">(*)</a> :: a -> a -> a</li><li><a href="#v:-45-">(-)</a> :: a -> a -> a</li><li><a href="#v:negate">negate</a> :: a -> a</li><li><a href="#v:abs">abs</a> :: a -> a</li><li><a href="#v:signum">signum</a> :: a -> a</li><li><a href="#v:fromInteger">fromInteger</a> :: <a href="Prelude.html#t:Integer">Integer</a> -> a</li></ul></li><li class="src short"><span class="keyword">class</span> (<a href="Prelude.html#t:Num">Num</a> a, <a href="Prelude.html#t:Ord">Ord</a> a) => <a href="#t:Real">Real</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:toRational">toRational</a> :: a -> <a href="Prelude.html#t:Rational">Rational</a></li></ul></li><li class="src short"><span class="keyword">class</span> (<a href="Prelude.html#t:Real">Real</a> a, <a href="Prelude.html#t:Enum">Enum</a> a) => <a href="#t:Integral">Integral</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:quot">quot</a> :: a -> a -> a</li><li><a href="#v:rem">rem</a> :: a -> a -> a</li><li><a href="#v:div">div</a> :: a -> a -> a</li><li><a href="#v:mod">mod</a> :: a -> a -> a</li><li><a href="#v:quotRem">quotRem</a> :: a -> a -> (a, a)</li><li><a href="#v:divMod">divMod</a> :: a -> a -> (a, a)</li><li><a href="#v:toInteger">toInteger</a> :: a -> <a href="Prelude.html#t:Integer">Integer</a></li></ul></li><li class="src short"><span class="keyword">class</span> <a href="Prelude.html#t:Num">Num</a> a => <a href="#t:Fractional">Fractional</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:-47-">(/)</a> :: a -> a -> a</li><li><a href="#v:recip">recip</a> :: a -> a</li><li><a href="#v:fromRational">fromRational</a> :: <a href="Prelude.html#t:Rational">Rational</a> -> a</li></ul></li><li class="src short"><span class="keyword">class</span> <a href="Prelude.html#t:Fractional">Fractional</a> a => <a href="#t:Floating">Floating</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:pi">pi</a> :: a</li><li><a href="#v:exp">exp</a> :: a -> a</li><li><a href="#v:sqrt">sqrt</a> :: a -> a</li><li><a href="#v:log">log</a> :: a -> a</li><li><a href="#v:-42--42-">(**)</a> :: a -> a -> a</li><li><a href="#v:logBase">logBase</a> :: a -> a -> a</li><li><a href="#v:sin">sin</a> :: a -> a</li><li><a href="#v:tan">tan</a> :: a -> a</li><li><a href="#v:cos">cos</a> :: a -> a</li><li><a href="#v:asin">asin</a> :: a -> a</li><li><a href="#v:atan">atan</a> :: a -> a</li><li><a href="#v:acos">acos</a> :: a -> a</li><li><a href="#v:sinh">sinh</a> :: a -> a</li><li><a href="#v:tanh">tanh</a> :: a -> a</li><li><a href="#v:cosh">cosh</a> :: a -> a</li><li><a href="#v:asinh">asinh</a> :: a -> a</li><li><a href="#v:atanh">atanh</a> :: a -> a</li><li><a href="#v:acosh">acosh</a> :: a -> a</li></ul></li><li class="src short"><span class="keyword">class</span> (<a href="Prelude.html#t:Real">Real</a> a, <a href="Prelude.html#t:Fractional">Fractional</a> a) => <a href="#t:RealFrac">RealFrac</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:properFraction">properFraction</a> :: <a href="Prelude.html#t:Integral">Integral</a> b => a -> (b, a)</li><li><a href="#v:truncate">truncate</a> :: <a href="Prelude.html#t:Integral">Integral</a> b => a -> b</li><li><a href="#v:round">round</a> :: <a href="Prelude.html#t:Integral">Integral</a> b => a -> b</li><li><a href="#v:ceiling">ceiling</a> :: <a href="Prelude.html#t:Integral">Integral</a> b => a -> b</li><li><a href="#v:floor">floor</a> :: <a href="Prelude.html#t:Integral">Integral</a> b => a -> b</li></ul></li><li class="src short"><span class="keyword">class</span> (<a href="Prelude.html#t:RealFrac">RealFrac</a> a, <a href="Prelude.html#t:Floating">Floating</a> a) => <a href="#t:RealFloat">RealFloat</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:floatRadix">floatRadix</a> :: a -> <a href="Prelude.html#t:Integer">Integer</a></li><li><a href="#v:floatDigits">floatDigits</a> :: a -> <a href="Prelude.html#t:Int">Int</a></li><li><a href="#v:floatRange">floatRange</a> :: a -> (<a href="Prelude.html#t:Int">Int</a>, <a href="Prelude.html#t:Int">Int</a>)</li><li><a href="#v:decodeFloat">decodeFloat</a> :: a -> (<a href="Prelude.html#t:Integer">Integer</a>, <a href="Prelude.html#t:Int">Int</a>)</li><li><a href="#v:encodeFloat">encodeFloat</a> :: <a href="Prelude.html#t:Integer">Integer</a> -> <a href="Prelude.html#t:Int">Int</a> -> a</li><li><a href="#v:exponent">exponent</a> :: a -> <a href="Prelude.html#t:Int">Int</a></li><li><a href="#v:significand">significand</a> :: a -> a</li><li><a href="#v:scaleFloat">scaleFloat</a> :: <a href="Prelude.html#t:Int">Int</a> -> a -> a</li><li><a href="#v:isNaN">isNaN</a> :: a -> <a href="Prelude.html#t:Bool">Bool</a></li><li><a href="#v:isInfinite">isInfinite</a> :: a -> <a href="Prelude.html#t:Bool">Bool</a></li><li><a href="#v:isDenormalized">isDenormalized</a> :: a -> <a href="Prelude.html#t:Bool">Bool</a></li><li><a href="#v:isNegativeZero">isNegativeZero</a> :: a -> <a href="Prelude.html#t:Bool">Bool</a></li><li><a href="#v:isIEEE">isIEEE</a> :: a -> <a href="Prelude.html#t:Bool">Bool</a></li><li><a href="#v:atan2">atan2</a> :: a -> a -> a</li></ul></li><li class="src short"><a href="#v:subtract">subtract</a> :: <a href="Prelude.html#t:Num">Num</a> a => a -> a -> a</li><li class="src short"><a href="#v:even">even</a> :: <a href="Prelude.html#t:Integral">Integral</a> a => a -> <a href="Prelude.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:odd">odd</a> :: <a href="Prelude.html#t:Integral">Integral</a> a => a -> <a href="Prelude.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:gcd">gcd</a> :: <a href="Prelude.html#t:Integral">Integral</a> a => a -> a -> a</li><li class="src short"><a href="#v:lcm">lcm</a> :: <a href="Prelude.html#t:Integral">Integral</a> a => a -> a -> a</li><li class="src short"><a href="#v:-94-">(^)</a> :: (<a href="Prelude.html#t:Num">Num</a> a, <a href="Prelude.html#t:Integral">Integral</a> b) => a -> b -> a</li><li class="src short"><a href="#v:-94--94-">(^^)</a> :: (<a href="Prelude.html#t:Fractional">Fractional</a> a, <a href="Prelude.html#t:Integral">Integral</a> b) => a -> b -> a</li><li class="src short"><a href="#v:fromIntegral">fromIntegral</a> :: (<a href="Prelude.html#t:Integral">Integral</a> a, <a href="Prelude.html#t:Num">Num</a> b) => a -> b</li><li class="src short"><a href="#v:realToFrac">realToFrac</a> :: (<a href="Prelude.html#t:Real">Real</a> a, <a href="Prelude.html#t:Fractional">Fractional</a> b) => a -> b</li><li class="src short"><span class="keyword">class</span> <a href="#t:Monad">Monad</a> m <span class="keyword">where</span><ul class="subs"><li><a href="#v:-62--62--61-">(>>=)</a> :: <span class="keyword">forall</span> a b. m a -> (a -> m b) -> m b</li><li><a href="#v:-62--62-">(>>)</a> :: <span class="keyword">forall</span> a b. m a -> m b -> m b</li><li><a href="#v:return">return</a> :: a -> m a</li><li><a href="#v:fail">fail</a> :: <a href="Prelude.html#t:String">String</a> -> m a</li></ul></li><li class="src short"><span class="keyword">class</span> <a href="#t:Functor">Functor</a> f <span class="keyword">where</span><ul class="subs"><li><a href="#v:fmap">fmap</a> :: (a -> b) -> f a -> f b</li></ul></li><li class="src short"><a href="#v:mapM">mapM</a> :: <a href="Prelude.html#t:Monad">Monad</a> m => (a -> m b) -> [a] -> m [b]</li><li class="src short"><a href="#v:mapM_">mapM_</a> :: <a href="Prelude.html#t:Monad">Monad</a> m => (a -> m b) -> [a] -> m <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:sequence">sequence</a> :: <a href="Prelude.html#t:Monad">Monad</a> m => [m a] -> m [a]</li><li class="src short"><a href="#v:sequence_">sequence_</a> :: <a href="Prelude.html#t:Monad">Monad</a> m => [m a] -> m <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:-61--60--60-">(=<<)</a> :: <a href="Prelude.html#t:Monad">Monad</a> m => (a -> m b) -> m a -> m b</li><li class="src short"><a href="#v:id">id</a> :: a -> a</li><li class="src short"><a href="#v:const">const</a> :: a -> b -> a</li><li class="src short"><a href="#v:.">(.)</a> :: (b -> c) -> (a -> b) -> a -> c</li><li class="src short"><a href="#v:flip">flip</a> :: (a -> b -> c) -> b -> a -> c</li><li class="src short"><a href="#v:-36-">($)</a> :: (a -> b) -> a -> b</li><li class="src short"><a href="#v:until">until</a> :: (a -> <a href="Prelude.html#t:Bool">Bool</a>) -> (a -> a) -> a -> a</li><li class="src short"><a href="#v:asTypeOf">asTypeOf</a> :: a -> a -> a</li><li class="src short"><a href="#v:error">error</a> :: [<a href="Prelude.html#t:Char">Char</a>] -> a</li><li class="src short"><a href="#v:undefined">undefined</a> :: a</li><li class="src short"><a href="#v:seq">seq</a> :: a -> b -> b</li><li class="src short"><a href="#v:-36--33-">($!)</a> :: (a -> b) -> a -> b</li><li class="src short"><a href="#v:map">map</a> :: (a -> b) -> [a] -> [b]</li><li class="src short"><a href="#v:-43--43-">(++)</a> :: [a] -> [a] -> [a]</li><li class="src short"><a href="#v:filter">filter</a> :: (a -> <a href="Prelude.html#t:Bool">Bool</a>) -> [a] -> [a]</li><li class="src short"><a href="#v:head">head</a> :: [a] -> a</li><li class="src short"><a href="#v:last">last</a> :: [a] -> a</li><li class="src short"><a href="#v:tail">tail</a> :: [a] -> [a]</li><li class="src short"><a href="#v:init">init</a> :: [a] -> [a]</li><li class="src short"><a href="#v:null">null</a> :: [a] -> <a href="Prelude.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:length">length</a> :: [a] -> <a href="Prelude.html#t:Int">Int</a></li><li class="src short"><a href="#v:-33--33-">(!!)</a> :: [a] -> <a href="Prelude.html#t:Int">Int</a> -> a</li><li class="src short"><a href="#v:reverse">reverse</a> :: [a] -> [a]</li><li class="src short"><a href="#v:foldl">foldl</a> :: (a -> b -> a) -> a -> [b] -> a</li><li class="src short"><a href="#v:foldl1">foldl1</a> :: (a -> a -> a) -> [a] -> a</li><li class="src short"><a href="#v:foldr">foldr</a> :: (a -> b -> b) -> b -> [a] -> b</li><li class="src short"><a href="#v:foldr1">foldr1</a> :: (a -> a -> a) -> [a] -> a</li><li class="src short"><a href="#v:and">and</a> :: [<a href="Prelude.html#t:Bool">Bool</a>] -> <a href="Prelude.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:or">or</a> :: [<a href="Prelude.html#t:Bool">Bool</a>] -> <a href="Prelude.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:any">any</a> :: (a -> <a href="Prelude.html#t:Bool">Bool</a>) -> [a] -> <a href="Prelude.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:all">all</a> :: (a -> <a href="Prelude.html#t:Bool">Bool</a>) -> [a] -> <a href="Prelude.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:sum">sum</a> :: <a href="Prelude.html#t:Num">Num</a> a => [a] -> a</li><li class="src short"><a href="#v:product">product</a> :: <a href="Prelude.html#t:Num">Num</a> a => [a] -> a</li><li class="src short"><a href="#v:concat">concat</a> :: [[a]] -> [a]</li><li class="src short"><a href="#v:concatMap">concatMap</a> :: (a -> [b]) -> [a] -> [b]</li><li class="src short"><a href="#v:maximum">maximum</a> :: <a href="Prelude.html#t:Ord">Ord</a> a => [a] -> a</li><li class="src short"><a href="#v:minimum">minimum</a> :: <a href="Prelude.html#t:Ord">Ord</a> a => [a] -> a</li><li class="src short"><a href="#v:scanl">scanl</a> :: (a -> b -> a) -> a -> [b] -> [a]</li><li class="src short"><a href="#v:scanl1">scanl1</a> :: (a -> a -> a) -> [a] -> [a]</li><li class="src short"><a href="#v:scanr">scanr</a> :: (a -> b -> b) -> b -> [a] -> [b]</li><li class="src short"><a href="#v:scanr1">scanr1</a> :: (a -> a -> a) -> [a] -> [a]</li><li class="src short"><a href="#v:iterate">iterate</a> :: (a -> a) -> a -> [a]</li><li class="src short"><a href="#v:repeat">repeat</a> :: a -> [a]</li><li class="src short"><a href="#v:replicate">replicate</a> :: <a href="Prelude.html#t:Int">Int</a> -> a -> [a]</li><li class="src short"><a href="#v:cycle">cycle</a> :: [a] -> [a]</li><li class="src short"><a href="#v:take">take</a> :: <a href="Prelude.html#t:Int">Int</a> -> [a] -> [a]</li><li class="src short"><a href="#v:drop">drop</a> :: <a href="Prelude.html#t:Int">Int</a> -> [a] -> [a]</li><li class="src short"><a href="#v:splitAt">splitAt</a> :: <a href="Prelude.html#t:Int">Int</a> -> [a] -> ([a], [a])</li><li class="src short"><a href="#v:takeWhile">takeWhile</a> :: (a -> <a href="Prelude.html#t:Bool">Bool</a>) -> [a] -> [a]</li><li class="src short"><a href="#v:dropWhile">dropWhile</a> :: (a -> <a href="Prelude.html#t:Bool">Bool</a>) -> [a] -> [a]</li><li class="src short"><a href="#v:span">span</a> :: (a -> <a href="Prelude.html#t:Bool">Bool</a>) -> [a] -> ([a], [a])</li><li class="src short"><a href="#v:break">break</a> :: (a -> <a href="Prelude.html#t:Bool">Bool</a>) -> [a] -> ([a], [a])</li><li class="src short"><a href="#v:elem">elem</a> :: <a href="Prelude.html#t:Eq">Eq</a> a => a -> [a] -> <a href="Prelude.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:notElem">notElem</a> :: <a href="Prelude.html#t:Eq">Eq</a> a => a -> [a] -> <a href="Prelude.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:lookup">lookup</a> :: <a href="Prelude.html#t:Eq">Eq</a> a => a -> [(a, b)] -> <a href="Prelude.html#t:Maybe">Maybe</a> b</li><li class="src short"><a href="#v:zip">zip</a> :: [a] -> [b] -> [(a, b)]</li><li class="src short"><a href="#v:zip3">zip3</a> :: [a] -> [b] -> [c] -> [(a, b, c)]</li><li class="src short"><a href="#v:zipWith">zipWith</a> :: (a -> b -> c) -> [a] -> [b] -> [c]</li><li class="src short"><a href="#v:zipWith3">zipWith3</a> :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]</li><li class="src short"><a href="#v:unzip">unzip</a> :: [(a, b)] -> ([a], [b])</li><li class="src short"><a href="#v:unzip3">unzip3</a> :: [(a, b, c)] -> ([a], [b], [c])</li><li class="src short"><a href="#v:lines">lines</a> :: <a href="Prelude.html#t:String">String</a> -> [<a href="Prelude.html#t:String">String</a>]</li><li class="src short"><a href="#v:words">words</a> :: <a href="Prelude.html#t:String">String</a> -> [<a href="Prelude.html#t:String">String</a>]</li><li class="src short"><a href="#v:unlines">unlines</a> :: [<a href="Prelude.html#t:String">String</a>] -> <a href="Prelude.html#t:String">String</a></li><li class="src short"><a href="#v:unwords">unwords</a> :: [<a href="Prelude.html#t:String">String</a>] -> <a href="Prelude.html#t:String">String</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:ShowS">ShowS</a> = <a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:String">String</a></li><li class="src short"><span class="keyword">class</span> <a href="#t:Show">Show</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:showsPrec">showsPrec</a> :: <a href="Prelude.html#t:Int">Int</a> -> a -> <a href="Prelude.html#t:ShowS">ShowS</a></li><li><a href="#v:show">show</a> :: a -> <a href="Prelude.html#t:String">String</a></li><li><a href="#v:showList">showList</a> :: [a] -> <a href="Prelude.html#t:ShowS">ShowS</a></li></ul></li><li class="src short"><a href="#v:shows">shows</a> :: <a href="Prelude.html#t:Show">Show</a> a => a -> <a href="Prelude.html#t:ShowS">ShowS</a></li><li class="src short"><a href="#v:showChar">showChar</a> :: <a href="Prelude.html#t:Char">Char</a> -> <a href="Prelude.html#t:ShowS">ShowS</a></li><li class="src short"><a href="#v:showString">showString</a> :: <a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:ShowS">ShowS</a></li><li class="src short"><a href="#v:showParen">showParen</a> :: <a href="Prelude.html#t:Bool">Bool</a> -> <a href="Prelude.html#t:ShowS">ShowS</a> -> <a href="Prelude.html#t:ShowS">ShowS</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:ReadS">ReadS</a> a = <a href="Prelude.html#t:String">String</a> -> [(a, <a href="Prelude.html#t:String">String</a>)]</li><li class="src short"><span class="keyword">class</span> <a href="#t:Read">Read</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:readsPrec">readsPrec</a> :: <a href="Prelude.html#t:Int">Int</a> -> <a href="Prelude.html#t:ReadS">ReadS</a> a</li><li><a href="#v:readList">readList</a> :: <a href="Prelude.html#t:ReadS">ReadS</a> [a]</li></ul></li><li class="src short"><a href="#v:reads">reads</a> :: <a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:ReadS">ReadS</a> a</li><li class="src short"><a href="#v:readParen">readParen</a> :: <a href="Prelude.html#t:Bool">Bool</a> -> <a href="Prelude.html#t:ReadS">ReadS</a> a -> <a href="Prelude.html#t:ReadS">ReadS</a> a</li><li class="src short"><a href="#v:read">read</a> :: <a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:String">String</a> -> a</li><li class="src short"><a href="#v:lex">lex</a> :: <a href="Prelude.html#t:ReadS">ReadS</a> <a href="Prelude.html#t:String">String</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:IO">IO</a> a</li><li class="src short"><a href="#v:putChar">putChar</a> :: <a href="Prelude.html#t:Char">Char</a> -> <a href="Prelude.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:putStr">putStr</a> :: <a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:putStrLn">putStrLn</a> :: <a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:print">print</a> :: <a href="Prelude.html#t:Show">Show</a> a => a -> <a href="Prelude.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:getChar">getChar</a> :: <a href="Prelude.html#t:IO">IO</a> <a href="Prelude.html#t:Char">Char</a></li><li class="src short"><a href="#v:getLine">getLine</a> :: <a href="Prelude.html#t:IO">IO</a> <a href="Prelude.html#t:String">String</a></li><li class="src short"><a href="#v:getContents">getContents</a> :: <a href="Prelude.html#t:IO">IO</a> <a href="Prelude.html#t:String">String</a></li><li class="src short"><a href="#v:interact">interact</a> :: (<a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:String">String</a>) -> <a href="Prelude.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:FilePath">FilePath</a> = <a href="Prelude.html#t:String">String</a></li><li class="src short"><a href="#v:readFile">readFile</a> :: <a href="Prelude.html#t:FilePath">FilePath</a> -> <a href="Prelude.html#t:IO">IO</a> <a href="Prelude.html#t:String">String</a></li><li class="src short"><a href="#v:writeFile">writeFile</a> :: <a href="Prelude.html#t:FilePath">FilePath</a> -> <a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:appendFile">appendFile</a> :: <a href="Prelude.html#t:FilePath">FilePath</a> -> <a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:readIO">readIO</a> :: <a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:readLn">readLn</a> :: <a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:IO">IO</a> a</li><li class="src short"><span class="keyword">type</span> <a href="#t:IOError">IOError</a> = <a href="Control-Exception-Base.html#t:IOException">IOException</a></li><li class="src short"><a href="#v:ioError">ioError</a> :: <a href="Prelude.html#t:IOError">IOError</a> -> <a href="Prelude.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:userError">userError</a> :: <a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:IOError">IOError</a></li><li class="src short"><a href="#v:catch">catch</a> :: <a href="Prelude.html#t:IO">IO</a> a -> (<a href="Prelude.html#t:IOError">IOError</a> -> <a href="Prelude.html#t:IO">IO</a> a) -> <a href="Prelude.html#t:IO">IO</a> a</li></ul></div><div id="interface"><h1 id="g:1">Standard types, classes and related functions </h1><h2 id="g:2">Basic data types </h2><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Bool" class="def">Bool</a> <a href="../ghc-prim-0.2.0.0/src/GHC-Bool.html#Bool" class="link">Source</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:False" class="def">False</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:True" class="def">True</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:Bool" class="caption collapser" onclick="toggleSection('i:Bool')">Instances</p><div id="section.i:Bool" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Prelude.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Prelude.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Prelude.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Data.html#t:Data">Data</a> <a href="Prelude.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Prelude.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Prelude.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Prelude.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Ix.html#t:Ix">Ix</a> <a href="Prelude.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Typeable.html#t:Typeable">Typeable</a> <a href="Prelude.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Foreign-Storable.html#t:Storable">Storable</a> <a href="Prelude.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:-38--38-" class="def">(&&)</a> :: <a href="Prelude.html#t:Bool">Bool</a> -> <a href="Prelude.html#t:Bool">Bool</a> -> <a href="Prelude.html#t:Bool">Bool</a></p><div class="doc"><p>Boolean "and" </p></div></div><div class="top"><p class="src"><a name="v:-124--124-" class="def">(||)</a> :: <a href="Prelude.html#t:Bool">Bool</a> -> <a href="Prelude.html#t:Bool">Bool</a> -> <a href="Prelude.html#t:Bool">Bool</a></p><div class="doc"><p>Boolean "or" </p></div></div><div class="top"><p class="src"><a name="v:not" class="def">not</a> :: <a href="Prelude.html#t:Bool">Bool</a> -> <a href="Prelude.html#t:Bool">Bool</a></p><div class="doc"><p>Boolean "not" </p></div></div><div class="top"><p class="src"><a name="v:otherwise" class="def">otherwise</a> :: <a href="Prelude.html#t:Bool">Bool</a></p><div class="doc"><p><code><a href="Prelude.html#v:otherwise">otherwise</a></code> is defined as the value <code><a href="Prelude.html#v:True">True</a></code>. It helps to make guards more readable. eg. </p><pre> f x | x < 0 = ... | otherwise = ... </pre></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Maybe" class="def">Maybe</a> a </p><div class="doc"><p>The <code><a href="Prelude.html#t:Maybe">Maybe</a></code> type encapsulates an optional value. A value of type <code><code><a href="Prelude.html#t:Maybe">Maybe</a></code> a</code> either contains a value of type <code>a</code> (represented as <code><code><a href="Prelude.html#v:Just">Just</a></code> a</code>), or it is empty (represented as <code><a href="Prelude.html#v:Nothing">Nothing</a></code>). Using <code><a href="Prelude.html#t:Maybe">Maybe</a></code> is a good way to deal with errors or exceptional cases without resorting to drastic measures such as <code><a href="Prelude.html#v:error">error</a></code>. </p><p>The <code><a href="Prelude.html#t:Maybe">Maybe</a></code> type is also a monad. It is a simple kind of error monad, where all errors are represented by <code><a href="Prelude.html#v:Nothing">Nothing</a></code>. A richer error monad can be built using the <code>Data.Either.Either</code> type. </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Nothing" class="def">Nothing</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:Just" class="def">Just</a> a</td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:Maybe" class="caption collapser" onclick="toggleSection('i:Maybe')">Instances</p><div id="section.i:Maybe" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Monad">Monad</a> <a href="Prelude.html#t:Maybe">Maybe</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> <a href="Prelude.html#t:Maybe">Maybe</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Typeable.html#t:Typeable1">Typeable1</a> <a href="Prelude.html#t:Maybe">Maybe</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Monad-Fix.html#t:MonadFix">MonadFix</a> <a href="Prelude.html#t:Maybe">Maybe</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Monad.html#t:MonadPlus">MonadPlus</a> <a href="Prelude.html#t:Maybe">Maybe</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Applicative.html#t:Applicative">Applicative</a> <a href="Prelude.html#t:Maybe">Maybe</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Foldable.html#t:Foldable">Foldable</a> <a href="Prelude.html#t:Maybe">Maybe</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Traversable.html#t:Traversable">Traversable</a> <a href="Prelude.html#t:Maybe">Maybe</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Applicative.html#t:Alternative">Alternative</a> <a href="Prelude.html#t:Maybe">Maybe</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> a => <a href="Prelude.html#t:Eq">Eq</a> (<a href="Prelude.html#t:Maybe">Maybe</a> a)</td><td class="doc empty"> </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> (<a href="Prelude.html#t:Maybe">Maybe</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> a => <a href="Prelude.html#t:Ord">Ord</a> (<a href="Prelude.html#t:Maybe">Maybe</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:Read">Read</a> (<a href="Prelude.html#t:Maybe">Maybe</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> a => <a href="Prelude.html#t:Show">Show</a> (<a href="Prelude.html#t:Maybe">Maybe</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Monoid.html#t:Monoid">Monoid</a> a => <a href="Data-Monoid.html#t:Monoid">Monoid</a> (<a href="Prelude.html#t:Maybe">Maybe</a> a)</td><td class="doc"><p>Lift a semigroup into <code><a href="Prelude.html#t:Maybe">Maybe</a></code> forming a <code><a href="Data-Monoid.html#t:Monoid">Monoid</a></code> according to <a href="http://en.wikipedia.org/wiki/Monoid">http://en.wikipedia.org/wiki/Monoid</a>: "Any semigroup <code>S</code> may be turned into a monoid simply by adjoining an element <code>e</code> not in <code>S</code> and defining <code>e*e = e</code> and <code>e*s = s = s*e</code> for all <code>s S</code>." Since there is no "Semigroup" typeclass providing just <code><a href="Data-Monoid.html#v:mappend">mappend</a></code>, we use <code><a href="Data-Monoid.html#t:Monoid">Monoid</a></code> instead. </p></td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:maybe" class="def">maybe</a> :: b -> (a -> b) -> <a href="Prelude.html#t:Maybe">Maybe</a> a -> b</p><div class="doc"><p>The <code><a href="Prelude.html#v:maybe">maybe</a></code> function takes a default value, a function, and a <code><a href="Prelude.html#t:Maybe">Maybe</a></code> value. If the <code><a href="Prelude.html#t:Maybe">Maybe</a></code> value is <code><a href="Prelude.html#v:Nothing">Nothing</a></code>, the function returns the default value. Otherwise, it applies the function to the value inside the <code><a href="Prelude.html#v:Just">Just</a></code> and returns the result. </p></div></div><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="Prelude.html#t:Either">Either</a></code> type represents values with two possibilities: a value of type <code><code><a href="Prelude.html#t:Either">Either</a></code> a b</code> is either <code><code><a href="Prelude.html#v:Left">Left</a></code> a</code> or <code><code><a href="Prelude.html#v:Right">Right</a></code> b</code>. </p><p>The <code><a href="Prelude.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="Prelude.html#v:Left">Left</a></code> constructor is used to hold an error value and the <code><a href="Prelude.html#v:Right">Right</a></code> constructor is used to hold a correct value (mnemonic: "right" also means "correct"). </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"> </td></tr><tr><td class="src"><a name="v:Right" class="def">Right</a> b</td><td class="doc empty"> </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.html#t:Typeable2">Typeable2</a> <a href="Prelude.html#t:Either">Either</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Monad">Monad</a> (<a href="Prelude.html#t:Either">Either</a> e)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> (<a href="Prelude.html#t:Either">Either</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Monad-Fix.html#t:MonadFix">MonadFix</a> (<a href="Prelude.html#t:Either">Either</a> e)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Applicative.html#t:Applicative">Applicative</a> (<a href="Prelude.html#t:Either">Either</a> e)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Eq">Eq</a> b) => <a href="Prelude.html#t:Eq">Eq</a> (<a href="Prelude.html#t:Either">Either</a> a b)</td><td class="doc empty"> </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) => <a href="Data-Data.html#t:Data">Data</a> (<a href="Prelude.html#t:Either">Either</a> a b)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Ord">Ord</a> a, <a href="Prelude.html#t:Ord">Ord</a> b) => <a href="Prelude.html#t:Ord">Ord</a> (<a href="Prelude.html#t:Either">Either</a> a b)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b) => <a href="Prelude.html#t:Read">Read</a> (<a href="Prelude.html#t:Either">Either</a> a b)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b) => <a href="Prelude.html#t:Show">Show</a> (<a href="Prelude.html#t:Either">Either</a> a b)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:either" class="def">either</a> :: (a -> c) -> (b -> c) -> <a href="Prelude.html#t:Either">Either</a> a b -> c</p><div class="doc"><p>Case analysis for the <code><a href="Prelude.html#t:Either">Either</a></code> type. If the value is <code><code><a href="Prelude.html#v:Left">Left</a></code> a</code>, apply the first function to <code>a</code>; if it is <code><code><a href="Prelude.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"><span class="keyword">data</span> <a name="t:Ordering" class="def">Ordering</a> <a href="../ghc-prim-0.2.0.0/src/GHC-Ordering.html#Ordering" class="link">Source</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:LT" class="def">LT</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:EQ" class="def">EQ</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:GT" class="def">GT</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:Ordering" class="caption collapser" onclick="toggleSection('i:Ordering')">Instances</p><div id="section.i:Ordering" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Prelude.html#t:Ordering">Ordering</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Prelude.html#t:Ordering">Ordering</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Prelude.html#t:Ordering">Ordering</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Data.html#t:Data">Data</a> <a href="Prelude.html#t:Ordering">Ordering</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Prelude.html#t:Ordering">Ordering</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Prelude.html#t:Ordering">Ordering</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Prelude.html#t:Ordering">Ordering</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Ix.html#t:Ix">Ix</a> <a href="Prelude.html#t:Ordering">Ordering</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Typeable.html#t:Typeable">Typeable</a> <a href="Prelude.html#t:Ordering">Ordering</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Monoid.html#t:Monoid">Monoid</a> <a href="Prelude.html#t:Ordering">Ordering</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Char" class="def">Char</a> <a href="../ghc-prim-0.2.0.0/src/GHC-Types.html#Char" class="link">Source</a></p><div class="doc"><p>The character type <code><a href="Prelude.html#t:Char">Char</a></code> is an enumeration whose values represent Unicode (or equivalently ISO/IEC 10646) characters (see <a href="http://www.unicode.org/">http://www.unicode.org/</a> for details). This set extends the ISO 8859-1 (Latin-1) character set (the first 256 charachers), which is itself an extension of the ASCII character set (the first 128 characters). A character literal in Haskell has type <code><a href="Prelude.html#t:Char">Char</a></code>. </p><p>To convert a <code><a href="Prelude.html#t:Char">Char</a></code> to or from the corresponding <code><a href="Prelude.html#t:Int">Int</a></code> value defined by Unicode, use <code>Prelude.toEnum</code> and <code>Prelude.fromEnum</code> from the <code>Prelude.Enum</code> class respectively (or equivalently <code>ord</code> and <code>chr</code>). </p></div><div class="subs instances"><p id="control.i:Char" class="caption collapser" onclick="toggleSection('i:Char')">Instances</p><div id="section.i:Char" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Data.html#t:Data">Data</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Ix.html#t:Ix">Ix</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Typeable.html#t:Typeable">Typeable</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Foreign-Storable.html#t:Storable">Storable</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Text-Printf.html#t:IsChar">IsChar</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Text-Printf.html#t:PrintfArg">PrintfArg</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-String.html#t:IsString">IsString</a> [<a href="Prelude.html#t:Char">Char</a>]</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:String" class="def">String</a> = [<a href="Prelude.html#t:Char">Char</a>]</p><div class="doc"><p>A <code><a href="Prelude.html#t:String">String</a></code> is a list of characters. String constants in Haskell are values of type <code><a href="Prelude.html#t:String">String</a></code>. </p></div></div><h3 id="g:3">Tuples </h3><div class="top"><p class="src"><a name="v:fst" class="def">fst</a> :: (a, b) -> a</p><div class="doc"><p>Extract the first component of a pair. </p></div></div><div class="top"><p class="src"><a name="v:snd" class="def">snd</a> :: (a, b) -> b</p><div class="doc"><p>Extract the second component of a pair. </p></div></div><div class="top"><p class="src"><a name="v:curry" class="def">curry</a> :: ((a, b) -> c) -> a -> b -> c</p><div class="doc"><p><code><a href="Prelude.html#v:curry">curry</a></code> converts an uncurried function to a curried function. </p></div></div><div class="top"><p class="src"><a name="v:uncurry" class="def">uncurry</a> :: (a -> b -> c) -> (a, b) -> c</p><div class="doc"><p><code><a href="Prelude.html#v:uncurry">uncurry</a></code> converts a curried function to a function on pairs. </p></div></div><h2 id="g:4">Basic type classes </h2><div class="top"><p class="src"><span class="keyword">class</span> <a name="t:Eq" class="def">Eq</a> a <span class="keyword">where</span></p><div class="doc"><p>The <code><a href="Prelude.html#t:Eq">Eq</a></code> class defines equality (<code><a href="Prelude.html#v:-61--61-">==</a></code>) and inequality (<code><a href="Prelude.html#v:-47--61-">/=</a></code>). All the basic datatypes exported by the <a href="Prelude.html">Prelude</a> are instances of <code><a href="Prelude.html#t:Eq">Eq</a></code>, and <code><a href="Prelude.html#t:Eq">Eq</a></code> may be derived for any datatype whose constituents are also instances of <code><a href="Prelude.html#t:Eq">Eq</a></code>. </p><p>Minimal complete definition: either <code><a href="Prelude.html#v:-61--61-">==</a></code> or <code><a href="Prelude.html#v:-47--61-">/=</a></code>. </p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:-61--61-" class="def">(==)</a> :: a -> a -> <a href="Prelude.html#t:Bool">Bool</a></p><p class="src"><a name="v:-47--61-" class="def">(/=)</a> :: a -> a -> <a href="Prelude.html#t:Bool">Bool</a></p></div><div class="subs instances"><p id="control.i:Eq" class="caption collapser" onclick="toggleSection('i:Eq')">Instances</p><div id="section.i:Eq" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Prelude.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Int.html#t:Int8">Int8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Int.html#t:Int16">Int16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Int.html#t:Int32">Int32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Int.html#t:Int64">Int64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Prelude.html#t:Ordering">Ordering</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Word.html#t:Word">Word</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Word.html#t:Word8">Word8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Word.html#t:Word16">Word16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Word.html#t:Word32">Word32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Word.html#t:Word64">Word64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> ()</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Typeable.html#t:TyCon">TyCon</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Typeable.html#t:TypeRep">TypeRep</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Control-Exception-Base.html#t:ArithException">ArithException</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Control-Exception-Base.html#t:IOException">IOException</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Control-Exception-Base.html#t:MaskingState">MaskingState</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Text-Read-Lex.html#t:Lexeme">Lexeme</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-IO.html#t:IOMode">IOMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="GHC-IO-Device.html#t:SeekMode">SeekMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="GHC-IO-Device.html#t:IODeviceType">IODeviceType</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CUIntMax">CUIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CIntMax">CIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CUIntPtr">CUIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CIntPtr">CIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CTime">CTime</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CClock">CClock</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CSigAtomic">CSigAtomic</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CWchar">CWchar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CSize">CSize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CPtrdiff">CPtrdiff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CDouble">CDouble</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CFloat">CFloat</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CULLong">CULLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CLLong">CLLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CULong">CULong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CLong">CLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CUInt">CUInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CInt">CInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CUShort">CUShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CShort">CShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CUChar">CUChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CSChar">CSChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Types.html#t:CChar">CChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Monoid.html#t:Any">Any</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Monoid.html#t:All">All</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Char.html#t:GeneralCategory">GeneralCategory</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> Inserts</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> HashData</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> KeyPr</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> Key</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> Finalizers</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-Ptr.html#t:IntPtr">IntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-Ptr.html#t:WordPtr">WordPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="GHC-IO-Buffer.html#t:BufferState">BufferState</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="GHC-IO-Handle.html#t:NewlineMode">NewlineMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="GHC-IO-Handle.html#t:Newline">Newline</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="GHC-IO-Handle.html#t:BufferMode">BufferMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="GHC-IO-Handle.html#t:Handle">Handle</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-IO-Error.html#t:IOErrorType">IOErrorType</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Exit.html#t:ExitCode">ExitCode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Control-Exception-Base.html#t:ArrayException">ArrayException</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Control-Exception-Base.html#t:AsyncException">AsyncException</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Foreign-C-Error.html#t:Errno">Errno</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="GHC-Conc.html#t:ThreadStatus">ThreadStatus</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="GHC-Conc.html#t:BlockReason">BlockReason</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Control-Concurrent.html#t:ThreadId">ThreadId</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Posix-Types.html#t:Fd">Fd</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Posix-Types.html#t:CRLim">CRLim</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Posix-Types.html#t:CTcflag">CTcflag</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Posix-Types.html#t:CSpeed">CSpeed</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Posix-Types.html#t:CCc">CCc</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Posix-Types.html#t:CUid">CUid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Posix-Types.html#t:CNlink">CNlink</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Posix-Types.html#t:CGid">CGid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Posix-Types.html#t:CSsize">CSsize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Posix-Types.html#t:CPid">CPid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Posix-Types.html#t:COff">COff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Posix-Types.html#t:CMode">CMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Posix-Types.html#t:CIno">CIno</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Posix-Types.html#t:CDev">CDev</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> ControlMessage</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Event.html#t:Event">Event</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> EventType</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> EPollFd</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> Unique</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> State</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Event.html#t:TimeoutKey">TimeoutKey</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="System-Event.html#t:FdKey">FdKey</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="GHC-IO-Handle.html#t:HandlePosn">HandlePosn</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Data.html#t:Fixity">Fixity</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Data.html#t:ConstrRep">ConstrRep</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Data.html#t:DataRep">DataRep</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Data.html#t:Constr">Constr</a></td><td class="doc"><p>Equality of constructors </p></td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="GHC-Exts.html#t:SpecConstrAnnotation">SpecConstrAnnotation</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Unique.html#t:Unique">Unique</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> Timeout</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Data-Version.html#t:Version">Version</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Control-OldException.html#t:Exception">Exception</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> Event</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> a => <a href="Prelude.html#t:Eq">Eq</a> [a]</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> a => <a href="Prelude.html#t:Eq">Eq</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> (<a href="Foreign-StablePtr.html#t:StablePtr">StablePtr</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> (<a href="Foreign-Ptr.html#t:Ptr">Ptr</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> (<a href="Foreign-Ptr.html#t:FunPtr">FunPtr</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> a => <a href="Prelude.html#t:Eq">Eq</a> ([::] a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> a => <a href="Prelude.html#t:Eq">Eq</a> (<a href="Prelude.html#t:Maybe">Maybe</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> (<a href="Control-Concurrent-MVar.html#t:MVar">MVar</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> (<a href="Data-IORef.html#t:IORef">IORef</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> a => <a href="Prelude.html#t:Eq">Eq</a> (<a href="Data-Monoid.html#t:Last">Last</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> a => <a href="Prelude.html#t:Eq">Eq</a> (<a href="Data-Monoid.html#t:First">First</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> a => <a href="Prelude.html#t:Eq">Eq</a> (<a href="Data-Monoid.html#t:Product">Product</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> a => <a href="Prelude.html#t:Eq">Eq</a> (<a href="Data-Monoid.html#t:Sum">Sum</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> a => <a href="Prelude.html#t:Eq">Eq</a> (<a href="Data-Monoid.html#t:Dual">Dual</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> (<a href="Foreign-ForeignPtr.html#t:ForeignPtr">ForeignPtr</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> (<a href="GHC-Conc.html#t:TVar">TVar</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> a => <a href="Prelude.html#t:Eq">Eq</a> (IntMap a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> a => <a href="Prelude.html#t:Eq">Eq</a> (LTree a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> a => <a href="Prelude.html#t:Eq">Eq</a> (PSQ a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> a => <a href="Prelude.html#t:Eq">Eq</a> (Elem a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> a => <a href="Prelude.html#t:Eq">Eq</a> (<a href="GHC-Exts.html#t:Down">Down</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> (<a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:RealFloat">RealFloat</a> a => <a href="Prelude.html#t:Eq">Eq</a> (<a href="Data-Complex.html#t:Complex">Complex</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> (<a href="Data-Fixed.html#t:Fixed">Fixed</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> (<a href="System-Mem-StableName.html#t:StableName">StableName</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Eq">Eq</a> b) => <a href="Prelude.html#t:Eq">Eq</a> (<a href="Prelude.html#t:Either">Either</a> a b)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Eq">Eq</a> b) => <a href="Prelude.html#t:Eq">Eq</a> (a, b)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Data-Ix.html#t:Ix">Ix</a> i, <a href="Prelude.html#t:Eq">Eq</a> e) => <a href="Prelude.html#t:Eq">Eq</a> (Array i e)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> (IOArray i e)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> (<a href="Data-STRef.html#t:STRef">STRef</a> s a)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Eq">Eq</a> b, <a href="Prelude.html#t:Eq">Eq</a> c) => <a href="Prelude.html#t:Eq">Eq</a> (a, b, c)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> (STArray s i e)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Eq">Eq</a> b, <a href="Prelude.html#t:Eq">Eq</a> c, <a href="Prelude.html#t:Eq">Eq</a> d) => <a href="Prelude.html#t:Eq">Eq</a> (a, b, c, d)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Eq">Eq</a> b, <a href="Prelude.html#t:Eq">Eq</a> c, <a href="Prelude.html#t:Eq">Eq</a> d, <a href="Prelude.html#t:Eq">Eq</a> e) => <a href="Prelude.html#t:Eq">Eq</a> (a, b, c, d, e)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Eq">Eq</a> b, <a href="Prelude.html#t:Eq">Eq</a> c, <a href="Prelude.html#t:Eq">Eq</a> d, <a href="Prelude.html#t:Eq">Eq</a> e, <a href="Prelude.html#t:Eq">Eq</a> f) => <a href="Prelude.html#t:Eq">Eq</a> (a, b, c, d, e, f)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Eq">Eq</a> b, <a href="Prelude.html#t:Eq">Eq</a> c, <a href="Prelude.html#t:Eq">Eq</a> d, <a href="Prelude.html#t:Eq">Eq</a> e, <a href="Prelude.html#t:Eq">Eq</a> f, <a href="Prelude.html#t:Eq">Eq</a> g) => <a href="Prelude.html#t:Eq">Eq</a> (a, b, c, d, e, f, g)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Eq">Eq</a> b, <a href="Prelude.html#t:Eq">Eq</a> c, <a href="Prelude.html#t:Eq">Eq</a> d, <a href="Prelude.html#t:Eq">Eq</a> e, <a href="Prelude.html#t:Eq">Eq</a> f, <a href="Prelude.html#t:Eq">Eq</a> g, <a href="Prelude.html#t:Eq">Eq</a> h) => <a href="Prelude.html#t:Eq">Eq</a> (a, b, c, d, e, f, g, h)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Eq">Eq</a> b, <a href="Prelude.html#t:Eq">Eq</a> c, <a href="Prelude.html#t:Eq">Eq</a> d, <a href="Prelude.html#t:Eq">Eq</a> e, <a href="Prelude.html#t:Eq">Eq</a> f, <a href="Prelude.html#t:Eq">Eq</a> g, <a href="Prelude.html#t:Eq">Eq</a> h, <a href="Prelude.html#t:Eq">Eq</a> i) => <a href="Prelude.html#t:Eq">Eq</a> (a, b, c, d, e, f, g, h, i)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Eq">Eq</a> b, <a href="Prelude.html#t:Eq">Eq</a> c, <a href="Prelude.html#t:Eq">Eq</a> d, <a href="Prelude.html#t:Eq">Eq</a> e, <a href="Prelude.html#t:Eq">Eq</a> f, <a href="Prelude.html#t:Eq">Eq</a> g, <a href="Prelude.html#t:Eq">Eq</a> h, <a href="Prelude.html#t:Eq">Eq</a> i, <a href="Prelude.html#t:Eq">Eq</a> j) => <a href="Prelude.html#t:Eq">Eq</a> (a, b, c, d, e, f, g, h, i, j)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Eq">Eq</a> b, <a href="Prelude.html#t:Eq">Eq</a> c, <a href="Prelude.html#t:Eq">Eq</a> d, <a href="Prelude.html#t:Eq">Eq</a> e, <a href="Prelude.html#t:Eq">Eq</a> f, <a href="Prelude.html#t:Eq">Eq</a> g, <a href="Prelude.html#t:Eq">Eq</a> h, <a href="Prelude.html#t:Eq">Eq</a> i, <a href="Prelude.html#t:Eq">Eq</a> j, <a href="Prelude.html#t:Eq">Eq</a> k) => <a href="Prelude.html#t:Eq">Eq</a> (a, b, c, d, e, f, g, h, i, j, k)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Eq">Eq</a> b, <a href="Prelude.html#t:Eq">Eq</a> c, <a href="Prelude.html#t:Eq">Eq</a> d, <a href="Prelude.html#t:Eq">Eq</a> e, <a href="Prelude.html#t:Eq">Eq</a> f, <a href="Prelude.html#t:Eq">Eq</a> g, <a href="Prelude.html#t:Eq">Eq</a> h, <a href="Prelude.html#t:Eq">Eq</a> i, <a href="Prelude.html#t:Eq">Eq</a> j, <a href="Prelude.html#t:Eq">Eq</a> k, <a href="Prelude.html#t:Eq">Eq</a> l) => <a href="Prelude.html#t:Eq">Eq</a> (a, b, c, d, e, f, g, h, i, j, k, l)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Eq">Eq</a> b, <a href="Prelude.html#t:Eq">Eq</a> c, <a href="Prelude.html#t:Eq">Eq</a> d, <a href="Prelude.html#t:Eq">Eq</a> e, <a href="Prelude.html#t:Eq">Eq</a> f, <a href="Prelude.html#t:Eq">Eq</a> g, <a href="Prelude.html#t:Eq">Eq</a> h, <a href="Prelude.html#t:Eq">Eq</a> i, <a href="Prelude.html#t:Eq">Eq</a> j, <a href="Prelude.html#t:Eq">Eq</a> k, <a href="Prelude.html#t:Eq">Eq</a> l, <a href="Prelude.html#t:Eq">Eq</a> m) => <a href="Prelude.html#t:Eq">Eq</a> (a, b, c, d, e, f, g, h, i, j, k, l, m)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Eq">Eq</a> b, <a href="Prelude.html#t:Eq">Eq</a> c, <a href="Prelude.html#t:Eq">Eq</a> d, <a href="Prelude.html#t:Eq">Eq</a> e, <a href="Prelude.html#t:Eq">Eq</a> f, <a href="Prelude.html#t:Eq">Eq</a> g, <a href="Prelude.html#t:Eq">Eq</a> h, <a href="Prelude.html#t:Eq">Eq</a> i, <a href="Prelude.html#t:Eq">Eq</a> j, <a href="Prelude.html#t:Eq">Eq</a> k, <a href="Prelude.html#t:Eq">Eq</a> l, <a href="Prelude.html#t:Eq">Eq</a> m, <a href="Prelude.html#t:Eq">Eq</a> n) => <a href="Prelude.html#t:Eq">Eq</a> (a, b, c, d, e, f, g, h, i, j, k, l, m, n)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Eq">Eq</a> b, <a href="Prelude.html#t:Eq">Eq</a> c, <a href="Prelude.html#t:Eq">Eq</a> d, <a href="Prelude.html#t:Eq">Eq</a> e, <a href="Prelude.html#t:Eq">Eq</a> f, <a href="Prelude.html#t:Eq">Eq</a> g, <a href="Prelude.html#t:Eq">Eq</a> h, <a href="Prelude.html#t:Eq">Eq</a> i, <a href="Prelude.html#t:Eq">Eq</a> j, <a href="Prelude.html#t:Eq">Eq</a> k, <a href="Prelude.html#t:Eq">Eq</a> l, <a href="Prelude.html#t:Eq">Eq</a> m, <a href="Prelude.html#t:Eq">Eq</a> n, <a href="Prelude.html#t:Eq">Eq</a> o) => <a href="Prelude.html#t:Eq">Eq</a> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a href="Prelude.html#t:Eq">Eq</a> a => <a name="t:Ord" class="def">Ord</a> a <span class="keyword">where</span></p><div class="doc"><p>The <code><a href="Prelude.html#t:Ord">Ord</a></code> class is used for totally ordered datatypes. </p><p>Instances of <code><a href="Prelude.html#t:Ord">Ord</a></code> can be derived for any user-defined datatype whose constituent types are in <code><a href="Prelude.html#t:Ord">Ord</a></code>. The declared order of the constructors in the data declaration determines the ordering in derived <code><a href="Prelude.html#t:Ord">Ord</a></code> instances. The <code><a href="Prelude.html#t:Ordering">Ordering</a></code> datatype allows a single comparison to determine the precise ordering of two objects. </p><p>Minimal complete definition: either <code><a href="Prelude.html#v:compare">compare</a></code> or <code><a href="Prelude.html#v:-60--61-"><=</a></code>. Using <code><a href="Prelude.html#v:compare">compare</a></code> can be more efficient for complex types. </p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:compare" class="def">compare</a> :: a -> a -> <a href="Prelude.html#t:Ordering">Ordering</a></p><p class="src"><a name="v:-60-" class="def">(<)</a> :: a -> a -> <a href="Prelude.html#t:Bool">Bool</a></p><p class="src"><a name="v:-62--61-" class="def">(>=)</a> :: a -> a -> <a href="Prelude.html#t:Bool">Bool</a></p><p class="src"><a name="v:-62-" class="def">(>)</a> :: a -> a -> <a href="Prelude.html#t:Bool">Bool</a></p><p class="src"><a name="v:-60--61-" class="def">(<=)</a> :: a -> a -> <a href="Prelude.html#t:Bool">Bool</a></p><p class="src"><a name="v:max" class="def">max</a> :: a -> a -> a</p><p class="src"><a name="v:min" class="def">min</a> :: a -> a -> a</p></div><div class="subs instances"><p id="control.i:Ord" class="caption collapser" onclick="toggleSection('i:Ord')">Instances</p><div id="section.i:Ord" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Prelude.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Data-Int.html#t:Int8">Int8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Data-Int.html#t:Int16">Int16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Data-Int.html#t:Int32">Int32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Data-Int.html#t:Int64">Int64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Prelude.html#t:Ordering">Ordering</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Data-Word.html#t:Word">Word</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Data-Word.html#t:Word8">Word8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Data-Word.html#t:Word16">Word16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Data-Word.html#t:Word32">Word32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Data-Word.html#t:Word64">Word64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> ()</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Control-Exception-Base.html#t:ArithException">ArithException</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System-IO.html#t:IOMode">IOMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="GHC-IO-Device.html#t:SeekMode">SeekMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CUIntMax">CUIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CIntMax">CIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CUIntPtr">CUIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CIntPtr">CIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CTime">CTime</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CClock">CClock</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CSigAtomic">CSigAtomic</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CWchar">CWchar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CSize">CSize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CPtrdiff">CPtrdiff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CDouble">CDouble</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CFloat">CFloat</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CULLong">CULLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CLLong">CLLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CULong">CULong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CLong">CLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CUInt">CUInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CInt">CInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CUShort">CUShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CShort">CShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CUChar">CUChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CSChar">CSChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-C-Types.html#t:CChar">CChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Data-Monoid.html#t:Any">Any</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Data-Monoid.html#t:All">All</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Data-Char.html#t:GeneralCategory">GeneralCategory</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-Ptr.html#t:IntPtr">IntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Foreign-Ptr.html#t:WordPtr">WordPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="GHC-IO-Handle.html#t:NewlineMode">NewlineMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="GHC-IO-Handle.html#t:Newline">Newline</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="GHC-IO-Handle.html#t:BufferMode">BufferMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System-Exit.html#t:ExitCode">ExitCode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Control-Exception-Base.html#t:ArrayException">ArrayException</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Control-Exception-Base.html#t:AsyncException">AsyncException</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="GHC-Conc.html#t:ThreadStatus">ThreadStatus</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="GHC-Conc.html#t:BlockReason">BlockReason</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Control-Concurrent.html#t:ThreadId">ThreadId</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System-Posix-Types.html#t:Fd">Fd</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System-Posix-Types.html#t:CRLim">CRLim</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System-Posix-Types.html#t:CTcflag">CTcflag</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System-Posix-Types.html#t:CSpeed">CSpeed</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System-Posix-Types.html#t:CCc">CCc</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System-Posix-Types.html#t:CUid">CUid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System-Posix-Types.html#t:CNlink">CNlink</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System-Posix-Types.html#t:CGid">CGid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System-Posix-Types.html#t:CSsize">CSsize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System-Posix-Types.html#t:CPid">CPid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System-Posix-Types.html#t:COff">COff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System-Posix-Types.html#t:CMode">CMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System-Posix-Types.html#t:CIno">CIno</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System-Posix-Types.html#t:CDev">CDev</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> Unique</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Data-Unique.html#t:Unique">Unique</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Data-Version.html#t:Version">Version</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> a => <a href="Prelude.html#t:Ord">Ord</a> [a]</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> a => <a href="Prelude.html#t:Ord">Ord</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> (<a href="Foreign-Ptr.html#t:Ptr">Ptr</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> (<a href="Foreign-Ptr.html#t:FunPtr">FunPtr</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> a => <a href="Prelude.html#t:Ord">Ord</a> ([::] a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> a => <a href="Prelude.html#t:Ord">Ord</a> (<a href="Prelude.html#t:Maybe">Maybe</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> a => <a href="Prelude.html#t:Ord">Ord</a> (<a href="Data-Monoid.html#t:Last">Last</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> a => <a href="Prelude.html#t:Ord">Ord</a> (<a href="Data-Monoid.html#t:First">First</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> a => <a href="Prelude.html#t:Ord">Ord</a> (<a href="Data-Monoid.html#t:Product">Product</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> a => <a href="Prelude.html#t:Ord">Ord</a> (<a href="Data-Monoid.html#t:Sum">Sum</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> a => <a href="Prelude.html#t:Ord">Ord</a> (<a href="Data-Monoid.html#t:Dual">Dual</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> (<a href="Foreign-ForeignPtr.html#t:ForeignPtr">ForeignPtr</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> a => <a href="Prelude.html#t:Ord">Ord</a> (<a href="GHC-Exts.html#t:Down">Down</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> (<a href="Data-Fixed.html#t:Fixed">Fixed</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Ord">Ord</a> a, <a href="Prelude.html#t:Ord">Ord</a> b) => <a href="Prelude.html#t:Ord">Ord</a> (<a href="Prelude.html#t:Either">Either</a> a b)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Ord">Ord</a> a, <a href="Prelude.html#t:Ord">Ord</a> b) => <a href="Prelude.html#t:Ord">Ord</a> (a, b)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Data-Ix.html#t:Ix">Ix</a> i, <a href="Prelude.html#t:Ord">Ord</a> e) => <a href="Prelude.html#t:Ord">Ord</a> (Array i e)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Ord">Ord</a> a, <a href="Prelude.html#t:Ord">Ord</a> b, <a href="Prelude.html#t:Ord">Ord</a> c) => <a href="Prelude.html#t:Ord">Ord</a> (a, b, c)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Ord">Ord</a> a, <a href="Prelude.html#t:Ord">Ord</a> b, <a href="Prelude.html#t:Ord">Ord</a> c, <a href="Prelude.html#t:Ord">Ord</a> d) => <a href="Prelude.html#t:Ord">Ord</a> (a, b, c, d)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Ord">Ord</a> a, <a href="Prelude.html#t:Ord">Ord</a> b, <a href="Prelude.html#t:Ord">Ord</a> c, <a href="Prelude.html#t:Ord">Ord</a> d, <a href="Prelude.html#t:Ord">Ord</a> e) => <a href="Prelude.html#t:Ord">Ord</a> (a, b, c, d, e)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Ord">Ord</a> a, <a href="Prelude.html#t:Ord">Ord</a> b, <a href="Prelude.html#t:Ord">Ord</a> c, <a href="Prelude.html#t:Ord">Ord</a> d, <a href="Prelude.html#t:Ord">Ord</a> e, <a href="Prelude.html#t:Ord">Ord</a> f) => <a href="Prelude.html#t:Ord">Ord</a> (a, b, c, d, e, f)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Ord">Ord</a> a, <a href="Prelude.html#t:Ord">Ord</a> b, <a href="Prelude.html#t:Ord">Ord</a> c, <a href="Prelude.html#t:Ord">Ord</a> d, <a href="Prelude.html#t:Ord">Ord</a> e, <a href="Prelude.html#t:Ord">Ord</a> f, <a href="Prelude.html#t:Ord">Ord</a> g) => <a href="Prelude.html#t:Ord">Ord</a> (a, b, c, d, e, f, g)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Ord">Ord</a> a, <a href="Prelude.html#t:Ord">Ord</a> b, <a href="Prelude.html#t:Ord">Ord</a> c, <a href="Prelude.html#t:Ord">Ord</a> d, <a href="Prelude.html#t:Ord">Ord</a> e, <a href="Prelude.html#t:Ord">Ord</a> f, <a href="Prelude.html#t:Ord">Ord</a> g, <a href="Prelude.html#t:Ord">Ord</a> h) => <a href="Prelude.html#t:Ord">Ord</a> (a, b, c, d, e, f, g, h)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Ord">Ord</a> a, <a href="Prelude.html#t:Ord">Ord</a> b, <a href="Prelude.html#t:Ord">Ord</a> c, <a href="Prelude.html#t:Ord">Ord</a> d, <a href="Prelude.html#t:Ord">Ord</a> e, <a href="Prelude.html#t:Ord">Ord</a> f, <a href="Prelude.html#t:Ord">Ord</a> g, <a href="Prelude.html#t:Ord">Ord</a> h, <a href="Prelude.html#t:Ord">Ord</a> i) => <a href="Prelude.html#t:Ord">Ord</a> (a, b, c, d, e, f, g, h, i)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Ord">Ord</a> a, <a href="Prelude.html#t:Ord">Ord</a> b, <a href="Prelude.html#t:Ord">Ord</a> c, <a href="Prelude.html#t:Ord">Ord</a> d, <a href="Prelude.html#t:Ord">Ord</a> e, <a href="Prelude.html#t:Ord">Ord</a> f, <a href="Prelude.html#t:Ord">Ord</a> g, <a href="Prelude.html#t:Ord">Ord</a> h, <a href="Prelude.html#t:Ord">Ord</a> i, <a href="Prelude.html#t:Ord">Ord</a> j) => <a href="Prelude.html#t:Ord">Ord</a> (a, b, c, d, e, f, g, h, i, j)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Ord">Ord</a> a, <a href="Prelude.html#t:Ord">Ord</a> b, <a href="Prelude.html#t:Ord">Ord</a> c, <a href="Prelude.html#t:Ord">Ord</a> d, <a href="Prelude.html#t:Ord">Ord</a> e, <a href="Prelude.html#t:Ord">Ord</a> f, <a href="Prelude.html#t:Ord">Ord</a> g, <a href="Prelude.html#t:Ord">Ord</a> h, <a href="Prelude.html#t:Ord">Ord</a> i, <a href="Prelude.html#t:Ord">Ord</a> j, <a href="Prelude.html#t:Ord">Ord</a> k) => <a href="Prelude.html#t:Ord">Ord</a> (a, b, c, d, e, f, g, h, i, j, k)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Ord">Ord</a> a, <a href="Prelude.html#t:Ord">Ord</a> b, <a href="Prelude.html#t:Ord">Ord</a> c, <a href="Prelude.html#t:Ord">Ord</a> d, <a href="Prelude.html#t:Ord">Ord</a> e, <a href="Prelude.html#t:Ord">Ord</a> f, <a href="Prelude.html#t:Ord">Ord</a> g, <a href="Prelude.html#t:Ord">Ord</a> h, <a href="Prelude.html#t:Ord">Ord</a> i, <a href="Prelude.html#t:Ord">Ord</a> j, <a href="Prelude.html#t:Ord">Ord</a> k, <a href="Prelude.html#t:Ord">Ord</a> l) => <a href="Prelude.html#t:Ord">Ord</a> (a, b, c, d, e, f, g, h, i, j, k, l)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Ord">Ord</a> a, <a href="Prelude.html#t:Ord">Ord</a> b, <a href="Prelude.html#t:Ord">Ord</a> c, <a href="Prelude.html#t:Ord">Ord</a> d, <a href="Prelude.html#t:Ord">Ord</a> e, <a href="Prelude.html#t:Ord">Ord</a> f, <a href="Prelude.html#t:Ord">Ord</a> g, <a href="Prelude.html#t:Ord">Ord</a> h, <a href="Prelude.html#t:Ord">Ord</a> i, <a href="Prelude.html#t:Ord">Ord</a> j, <a href="Prelude.html#t:Ord">Ord</a> k, <a href="Prelude.html#t:Ord">Ord</a> l, <a href="Prelude.html#t:Ord">Ord</a> m) => <a href="Prelude.html#t:Ord">Ord</a> (a, b, c, d, e, f, g, h, i, j, k, l, m)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Ord">Ord</a> a, <a href="Prelude.html#t:Ord">Ord</a> b, <a href="Prelude.html#t:Ord">Ord</a> c, <a href="Prelude.html#t:Ord">Ord</a> d, <a href="Prelude.html#t:Ord">Ord</a> e, <a href="Prelude.html#t:Ord">Ord</a> f, <a href="Prelude.html#t:Ord">Ord</a> g, <a href="Prelude.html#t:Ord">Ord</a> h, <a href="Prelude.html#t:Ord">Ord</a> i, <a href="Prelude.html#t:Ord">Ord</a> j, <a href="Prelude.html#t:Ord">Ord</a> k, <a href="Prelude.html#t:Ord">Ord</a> l, <a href="Prelude.html#t:Ord">Ord</a> m, <a href="Prelude.html#t:Ord">Ord</a> n) => <a href="Prelude.html#t:Ord">Ord</a> (a, b, c, d, e, f, g, h, i, j, k, l, m, n)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Ord">Ord</a> a, <a href="Prelude.html#t:Ord">Ord</a> b, <a href="Prelude.html#t:Ord">Ord</a> c, <a href="Prelude.html#t:Ord">Ord</a> d, <a href="Prelude.html#t:Ord">Ord</a> e, <a href="Prelude.html#t:Ord">Ord</a> f, <a href="Prelude.html#t:Ord">Ord</a> g, <a href="Prelude.html#t:Ord">Ord</a> h, <a href="Prelude.html#t:Ord">Ord</a> i, <a href="Prelude.html#t:Ord">Ord</a> j, <a href="Prelude.html#t:Ord">Ord</a> k, <a href="Prelude.html#t:Ord">Ord</a> l, <a href="Prelude.html#t:Ord">Ord</a> m, <a href="Prelude.html#t:Ord">Ord</a> n, <a href="Prelude.html#t:Ord">Ord</a> o) => <a href="Prelude.html#t:Ord">Ord</a> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a name="t:Enum" class="def">Enum</a> a <span class="keyword">where</span></p><div class="doc"><p>Class <code><a href="Prelude.html#t:Enum">Enum</a></code> defines operations on sequentially ordered types. </p><p>The <code>enumFrom</code>... methods are used in Haskell's translation of arithmetic sequences. </p><p>Instances of <code><a href="Prelude.html#t:Enum">Enum</a></code> may be derived for any enumeration type (types whose constructors have no fields). The nullary constructors are assumed to be numbered left-to-right by <code><a href="Prelude.html#v:fromEnum">fromEnum</a></code> from <code>0</code> through <code>n-1</code>. See Chapter 10 of the <em>Haskell Report</em> for more details. </p><p>For any type that is an instance of class <code><a href="Prelude.html#t:Bounded">Bounded</a></code> as well as <code><a href="Prelude.html#t:Enum">Enum</a></code>, the following should hold: </p><ul><li> The calls <code><code><a href="Prelude.html#v:succ">succ</a></code> <code><a href="Prelude.html#v:maxBound">maxBound</a></code></code> and <code><code><a href="Prelude.html#v:pred">pred</a></code> <code><a href="Prelude.html#v:minBound">minBound</a></code></code> should result in a runtime error. </li><li> <code><a href="Prelude.html#v:fromEnum">fromEnum</a></code> and <code><a href="Prelude.html#v:toEnum">toEnum</a></code> should give a runtime error if the result value is not representable in the result type. For example, <code><code><a href="Prelude.html#v:toEnum">toEnum</a></code> 7 :: <code><a href="Prelude.html#t:Bool">Bool</a></code></code> is an error. </li><li> <code><a href="Prelude.html#v:enumFrom">enumFrom</a></code> and <code><a href="Prelude.html#v:enumFromThen">enumFromThen</a></code> should be defined with an implicit bound, thus: </li></ul><pre> enumFrom x = enumFromTo x maxBound enumFromThen x y = enumFromThenTo x y bound where bound | fromEnum y >= fromEnum x = maxBound | otherwise = minBound </pre></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:succ" class="def">succ</a> :: a -> a</p><div class="doc"><p>the successor of a value. For numeric types, <code><a href="Prelude.html#v:succ">succ</a></code> adds 1. </p></div><p class="src"><a name="v:pred" class="def">pred</a> :: a -> a</p><div class="doc"><p>the predecessor of a value. For numeric types, <code><a href="Prelude.html#v:pred">pred</a></code> subtracts 1. </p></div><p class="src"><a name="v:toEnum" class="def">toEnum</a> :: <a href="Prelude.html#t:Int">Int</a> -> a</p><div class="doc"><p>Convert from an <code><a href="Prelude.html#t:Int">Int</a></code>. </p></div><p class="src"><a name="v:fromEnum" class="def">fromEnum</a> :: a -> <a href="Prelude.html#t:Int">Int</a></p><div class="doc"><p>Convert to an <code><a href="Prelude.html#t:Int">Int</a></code>. It is implementation-dependent what <code><a href="Prelude.html#v:fromEnum">fromEnum</a></code> returns when applied to a value that is too large to fit in an <code><a href="Prelude.html#t:Int">Int</a></code>. </p></div><p class="src"><a name="v:enumFrom" class="def">enumFrom</a> :: a -> [a]</p><div class="doc"><p>Used in Haskell's translation of <code>[n..]</code>. </p></div><p class="src"><a name="v:enumFromThen" class="def">enumFromThen</a> :: a -> a -> [a]</p><div class="doc"><p>Used in Haskell's translation of <code>[n,n'..]</code>. </p></div><p class="src"><a name="v:enumFromTo" class="def">enumFromTo</a> :: a -> a -> [a]</p><div class="doc"><p>Used in Haskell's translation of <code>[n..m]</code>. </p></div><p class="src"><a name="v:enumFromThenTo" class="def">enumFromThenTo</a> :: a -> a -> a -> [a]</p><div class="doc"><p>Used in Haskell's translation of <code>[n,n'..m]</code>. </p></div></div><div class="subs instances"><p id="control.i:Enum" class="caption collapser" onclick="toggleSection('i:Enum')">Instances</p><div id="section.i:Enum" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Prelude.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Data-Int.html#t:Int8">Int8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Data-Int.html#t:Int16">Int16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Data-Int.html#t:Int32">Int32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Data-Int.html#t:Int64">Int64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Prelude.html#t:Ordering">Ordering</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Data-Word.html#t:Word">Word</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Data-Word.html#t:Word8">Word8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Data-Word.html#t:Word16">Word16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Data-Word.html#t:Word32">Word32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Data-Word.html#t:Word64">Word64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> ()</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="System-IO.html#t:IOMode">IOMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="GHC-IO-Device.html#t:SeekMode">SeekMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CUIntMax">CUIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CIntMax">CIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CUIntPtr">CUIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CIntPtr">CIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CTime">CTime</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CClock">CClock</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CSigAtomic">CSigAtomic</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CWchar">CWchar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CSize">CSize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CPtrdiff">CPtrdiff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CDouble">CDouble</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CFloat">CFloat</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CULLong">CULLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CLLong">CLLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CULong">CULong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CLong">CLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CUInt">CUInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CInt">CInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CUShort">CUShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CShort">CShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CUChar">CUChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CSChar">CSChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-C-Types.html#t:CChar">CChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Data-Char.html#t:GeneralCategory">GeneralCategory</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-Ptr.html#t:IntPtr">IntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Foreign-Ptr.html#t:WordPtr">WordPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="System-Posix-Types.html#t:Fd">Fd</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="System-Posix-Types.html#t:CRLim">CRLim</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="System-Posix-Types.html#t:CTcflag">CTcflag</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="System-Posix-Types.html#t:CSpeed">CSpeed</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="System-Posix-Types.html#t:CCc">CCc</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="System-Posix-Types.html#t:CUid">CUid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="System-Posix-Types.html#t:CNlink">CNlink</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="System-Posix-Types.html#t:CGid">CGid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="System-Posix-Types.html#t:CSsize">CSsize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="System-Posix-Types.html#t:CPid">CPid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="System-Posix-Types.html#t:COff">COff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="System-Posix-Types.html#t:CMode">CMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="System-Posix-Types.html#t:CIno">CIno</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="System-Posix-Types.html#t:CDev">CDev</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> a => <a href="Prelude.html#t:Enum">Enum</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> (<a href="Data-Fixed.html#t:Fixed">Fixed</a> a)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a name="t:Bounded" class="def">Bounded</a> a <span class="keyword">where</span></p><div class="doc"><p>The <code><a href="Prelude.html#t:Bounded">Bounded</a></code> class is used to name the upper and lower limits of a type. <code><a href="Prelude.html#t:Ord">Ord</a></code> is not a superclass of <code><a href="Prelude.html#t:Bounded">Bounded</a></code> since types that are not totally ordered may also have upper and lower bounds. </p><p>The <code><a href="Prelude.html#t:Bounded">Bounded</a></code> class may be derived for any enumeration type; <code><a href="Prelude.html#v:minBound">minBound</a></code> is the first constructor listed in the <code>data</code> declaration and <code><a href="Prelude.html#v:maxBound">maxBound</a></code> is the last. <code><a href="Prelude.html#t:Bounded">Bounded</a></code> may also be derived for single-constructor datatypes whose constituent types are in <code><a href="Prelude.html#t:Bounded">Bounded</a></code>. </p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:minBound" class="def">minBound</a> :: a</p><p class="src"><a name="v:maxBound" class="def">maxBound</a> :: a</p></div><div class="subs instances"><p id="control.i:Bounded" class="caption collapser" onclick="toggleSection('i:Bounded')">Instances</p><div id="section.i:Bounded" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Prelude.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Data-Int.html#t:Int8">Int8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Data-Int.html#t:Int16">Int16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Data-Int.html#t:Int32">Int32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Data-Int.html#t:Int64">Int64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Prelude.html#t:Ordering">Ordering</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Data-Word.html#t:Word">Word</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Data-Word.html#t:Word8">Word8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Data-Word.html#t:Word16">Word16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Data-Word.html#t:Word32">Word32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Data-Word.html#t:Word64">Word64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> ()</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CUIntMax">CUIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CIntMax">CIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CUIntPtr">CUIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CIntPtr">CIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CSigAtomic">CSigAtomic</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CWchar">CWchar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CSize">CSize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CPtrdiff">CPtrdiff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CULLong">CULLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CLLong">CLLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CULong">CULong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CLong">CLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CUInt">CUInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CInt">CInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CUShort">CUShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CShort">CShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CUChar">CUChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CSChar">CSChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-C-Types.html#t:CChar">CChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Data-Monoid.html#t:Any">Any</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Data-Monoid.html#t:All">All</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Data-Char.html#t:GeneralCategory">GeneralCategory</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-Ptr.html#t:IntPtr">IntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Foreign-Ptr.html#t:WordPtr">WordPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="System-Posix-Types.html#t:Fd">Fd</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="System-Posix-Types.html#t:CRLim">CRLim</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="System-Posix-Types.html#t:CTcflag">CTcflag</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="System-Posix-Types.html#t:CUid">CUid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="System-Posix-Types.html#t:CNlink">CNlink</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="System-Posix-Types.html#t:CGid">CGid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="System-Posix-Types.html#t:CSsize">CSsize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="System-Posix-Types.html#t:CPid">CPid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="System-Posix-Types.html#t:COff">COff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="System-Posix-Types.html#t:CMode">CMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="System-Posix-Types.html#t:CIno">CIno</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> a => <a href="Prelude.html#t:Bounded">Bounded</a> (<a href="Data-Monoid.html#t:Product">Product</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> a => <a href="Prelude.html#t:Bounded">Bounded</a> (<a href="Data-Monoid.html#t:Sum">Sum</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> a => <a href="Prelude.html#t:Bounded">Bounded</a> (<a href="Data-Monoid.html#t:Dual">Dual</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Bounded">Bounded</a> a, <a href="Prelude.html#t:Bounded">Bounded</a> b) => <a href="Prelude.html#t:Bounded">Bounded</a> (a, b)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Bounded">Bounded</a> a, <a href="Prelude.html#t:Bounded">Bounded</a> b, <a href="Prelude.html#t:Bounded">Bounded</a> c) => <a href="Prelude.html#t:Bounded">Bounded</a> (a, b, c)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Bounded">Bounded</a> a, <a href="Prelude.html#t:Bounded">Bounded</a> b, <a href="Prelude.html#t:Bounded">Bounded</a> c, <a href="Prelude.html#t:Bounded">Bounded</a> d) => <a href="Prelude.html#t:Bounded">Bounded</a> (a, b, c, d)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Bounded">Bounded</a> a, <a href="Prelude.html#t:Bounded">Bounded</a> b, <a href="Prelude.html#t:Bounded">Bounded</a> c, <a href="Prelude.html#t:Bounded">Bounded</a> d, <a href="Prelude.html#t:Bounded">Bounded</a> e) => <a href="Prelude.html#t:Bounded">Bounded</a> (a, b, c, d, e)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Bounded">Bounded</a> a, <a href="Prelude.html#t:Bounded">Bounded</a> b, <a href="Prelude.html#t:Bounded">Bounded</a> c, <a href="Prelude.html#t:Bounded">Bounded</a> d, <a href="Prelude.html#t:Bounded">Bounded</a> e, <a href="Prelude.html#t:Bounded">Bounded</a> f) => <a href="Prelude.html#t:Bounded">Bounded</a> (a, b, c, d, e, f)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Bounded">Bounded</a> a, <a href="Prelude.html#t:Bounded">Bounded</a> b, <a href="Prelude.html#t:Bounded">Bounded</a> c, <a href="Prelude.html#t:Bounded">Bounded</a> d, <a href="Prelude.html#t:Bounded">Bounded</a> e, <a href="Prelude.html#t:Bounded">Bounded</a> f, <a href="Prelude.html#t:Bounded">Bounded</a> g) => <a href="Prelude.html#t:Bounded">Bounded</a> (a, b, c, d, e, f, g)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Bounded">Bounded</a> a, <a href="Prelude.html#t:Bounded">Bounded</a> b, <a href="Prelude.html#t:Bounded">Bounded</a> c, <a href="Prelude.html#t:Bounded">Bounded</a> d, <a href="Prelude.html#t:Bounded">Bounded</a> e, <a href="Prelude.html#t:Bounded">Bounded</a> f, <a href="Prelude.html#t:Bounded">Bounded</a> g, <a href="Prelude.html#t:Bounded">Bounded</a> h) => <a href="Prelude.html#t:Bounded">Bounded</a> (a, b, c, d, e, f, g, h)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Bounded">Bounded</a> a, <a href="Prelude.html#t:Bounded">Bounded</a> b, <a href="Prelude.html#t:Bounded">Bounded</a> c, <a href="Prelude.html#t:Bounded">Bounded</a> d, <a href="Prelude.html#t:Bounded">Bounded</a> e, <a href="Prelude.html#t:Bounded">Bounded</a> f, <a href="Prelude.html#t:Bounded">Bounded</a> g, <a href="Prelude.html#t:Bounded">Bounded</a> h, <a href="Prelude.html#t:Bounded">Bounded</a> i) => <a href="Prelude.html#t:Bounded">Bounded</a> (a, b, c, d, e, f, g, h, i)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Bounded">Bounded</a> a, <a href="Prelude.html#t:Bounded">Bounded</a> b, <a href="Prelude.html#t:Bounded">Bounded</a> c, <a href="Prelude.html#t:Bounded">Bounded</a> d, <a href="Prelude.html#t:Bounded">Bounded</a> e, <a href="Prelude.html#t:Bounded">Bounded</a> f, <a href="Prelude.html#t:Bounded">Bounded</a> g, <a href="Prelude.html#t:Bounded">Bounded</a> h, <a href="Prelude.html#t:Bounded">Bounded</a> i, <a href="Prelude.html#t:Bounded">Bounded</a> j) => <a href="Prelude.html#t:Bounded">Bounded</a> (a, b, c, d, e, f, g, h, i, j)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Bounded">Bounded</a> a, <a href="Prelude.html#t:Bounded">Bounded</a> b, <a href="Prelude.html#t:Bounded">Bounded</a> c, <a href="Prelude.html#t:Bounded">Bounded</a> d, <a href="Prelude.html#t:Bounded">Bounded</a> e, <a href="Prelude.html#t:Bounded">Bounded</a> f, <a href="Prelude.html#t:Bounded">Bounded</a> g, <a href="Prelude.html#t:Bounded">Bounded</a> h, <a href="Prelude.html#t:Bounded">Bounded</a> i, <a href="Prelude.html#t:Bounded">Bounded</a> j, <a href="Prelude.html#t:Bounded">Bounded</a> k) => <a href="Prelude.html#t:Bounded">Bounded</a> (a, b, c, d, e, f, g, h, i, j, k)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Bounded">Bounded</a> a, <a href="Prelude.html#t:Bounded">Bounded</a> b, <a href="Prelude.html#t:Bounded">Bounded</a> c, <a href="Prelude.html#t:Bounded">Bounded</a> d, <a href="Prelude.html#t:Bounded">Bounded</a> e, <a href="Prelude.html#t:Bounded">Bounded</a> f, <a href="Prelude.html#t:Bounded">Bounded</a> g, <a href="Prelude.html#t:Bounded">Bounded</a> h, <a href="Prelude.html#t:Bounded">Bounded</a> i, <a href="Prelude.html#t:Bounded">Bounded</a> j, <a href="Prelude.html#t:Bounded">Bounded</a> k, <a href="Prelude.html#t:Bounded">Bounded</a> l) => <a href="Prelude.html#t:Bounded">Bounded</a> (a, b, c, d, e, f, g, h, i, j, k, l)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Bounded">Bounded</a> a, <a href="Prelude.html#t:Bounded">Bounded</a> b, <a href="Prelude.html#t:Bounded">Bounded</a> c, <a href="Prelude.html#t:Bounded">Bounded</a> d, <a href="Prelude.html#t:Bounded">Bounded</a> e, <a href="Prelude.html#t:Bounded">Bounded</a> f, <a href="Prelude.html#t:Bounded">Bounded</a> g, <a href="Prelude.html#t:Bounded">Bounded</a> h, <a href="Prelude.html#t:Bounded">Bounded</a> i, <a href="Prelude.html#t:Bounded">Bounded</a> j, <a href="Prelude.html#t:Bounded">Bounded</a> k, <a href="Prelude.html#t:Bounded">Bounded</a> l, <a href="Prelude.html#t:Bounded">Bounded</a> m) => <a href="Prelude.html#t:Bounded">Bounded</a> (a, b, c, d, e, f, g, h, i, j, k, l, m)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Bounded">Bounded</a> a, <a href="Prelude.html#t:Bounded">Bounded</a> b, <a href="Prelude.html#t:Bounded">Bounded</a> c, <a href="Prelude.html#t:Bounded">Bounded</a> d, <a href="Prelude.html#t:Bounded">Bounded</a> e, <a href="Prelude.html#t:Bounded">Bounded</a> f, <a href="Prelude.html#t:Bounded">Bounded</a> g, <a href="Prelude.html#t:Bounded">Bounded</a> h, <a href="Prelude.html#t:Bounded">Bounded</a> i, <a href="Prelude.html#t:Bounded">Bounded</a> j, <a href="Prelude.html#t:Bounded">Bounded</a> k, <a href="Prelude.html#t:Bounded">Bounded</a> l, <a href="Prelude.html#t:Bounded">Bounded</a> m, <a href="Prelude.html#t:Bounded">Bounded</a> n) => <a href="Prelude.html#t:Bounded">Bounded</a> (a, b, c, d, e, f, g, h, i, j, k, l, m, n)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Bounded">Bounded</a> a, <a href="Prelude.html#t:Bounded">Bounded</a> b, <a href="Prelude.html#t:Bounded">Bounded</a> c, <a href="Prelude.html#t:Bounded">Bounded</a> d, <a href="Prelude.html#t:Bounded">Bounded</a> e, <a href="Prelude.html#t:Bounded">Bounded</a> f, <a href="Prelude.html#t:Bounded">Bounded</a> g, <a href="Prelude.html#t:Bounded">Bounded</a> h, <a href="Prelude.html#t:Bounded">Bounded</a> i, <a href="Prelude.html#t:Bounded">Bounded</a> j, <a href="Prelude.html#t:Bounded">Bounded</a> k, <a href="Prelude.html#t:Bounded">Bounded</a> l, <a href="Prelude.html#t:Bounded">Bounded</a> m, <a href="Prelude.html#t:Bounded">Bounded</a> n, <a href="Prelude.html#t:Bounded">Bounded</a> o) => <a href="Prelude.html#t:Bounded">Bounded</a> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)</td><td class="doc empty"> </td></tr></table></div></div></div><h2 id="g:5">Numbers </h2><h3 id="g:6">Numeric types </h3><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Int" class="def">Int</a> <a href="../ghc-prim-0.2.0.0/src/GHC-Types.html#Int" class="link">Source</a></p><div class="doc"><p>A fixed-precision integer type with at least the range <code>[-2^29 .. 2^29-1]</code>. The exact range for a given implementation can be determined by using <code>Prelude.minBound</code> and <code>Prelude.maxBound</code> from the <code>Prelude.Bounded</code> class. </p></div><div class="subs instances"><p id="control.i:Int" class="caption collapser" onclick="toggleSection('i:Int')">Instances</p><div id="section.i:Int" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Bounded">Bounded</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Data.html#t:Data">Data</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Ix.html#t:Ix">Ix</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Typeable.html#t:Typeable">Typeable</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Bits.html#t:Bits">Bits</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Foreign-Storable.html#t:Storable">Storable</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Text-Printf.html#t:PrintfArg">PrintfArg</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Integer" class="def">Integer</a> <a href="../integer-gmp-0.2.0.3/src/GHC-Integer-Type.html#Integer" class="link">Source</a></p><div class="doc"><p>Arbitrary-precision integers. </p></div><div class="subs instances"><p id="control.i:Integer" class="caption collapser" onclick="toggleSection('i:Integer')">Instances</p><div id="section.i:Integer" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Data.html#t:Data">Data</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Ix.html#t:Ix">Ix</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Typeable.html#t:Typeable">Typeable</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Bits.html#t:Bits">Bits</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Text-Printf.html#t:PrintfArg">PrintfArg</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Float" class="def">Float</a> <a href="../ghc-prim-0.2.0.0/src/GHC-Types.html#Float" class="link">Source</a></p><div class="doc"><p>Single-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE single-precision type. </p></div><div class="subs instances"><p id="control.i:Float" class="caption collapser" onclick="toggleSection('i:Float')">Instances</p><div id="section.i:Float" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Floating">Floating</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Fractional">Fractional</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Data.html#t:Data">Data</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:RealFloat">RealFloat</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:RealFrac">RealFrac</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Typeable.html#t:Typeable">Typeable</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Foreign-Storable.html#t:Storable">Storable</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Text-Printf.html#t:PrintfArg">PrintfArg</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Double" class="def">Double</a> <a href="../ghc-prim-0.2.0.0/src/GHC-Types.html#Double" class="link">Source</a></p><div class="doc"><p>Double-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE double-precision type. </p></div><div class="subs instances"><p id="control.i:Double" class="caption collapser" onclick="toggleSection('i:Double')">Instances</p><div id="section.i:Double" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Enum">Enum</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Eq">Eq</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Floating">Floating</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Fractional">Fractional</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Data.html#t:Data">Data</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:RealFloat">RealFloat</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:RealFrac">RealFrac</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Typeable.html#t:Typeable">Typeable</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Foreign-Storable.html#t:Storable">Storable</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Text-Printf.html#t:PrintfArg">PrintfArg</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </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><h3 id="g:7">Numeric type classes </h3><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Prelude.html#t:Eq">Eq</a> a, <a href="Prelude.html#t:Show">Show</a> a) => <a name="t:Num" class="def">Num</a> a <span class="keyword">where</span></p><div class="doc"><p>Basic numeric class. </p><p>Minimal complete definition: all except <code><a href="Prelude.html#v:negate">negate</a></code> or <code>(-)</code> </p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:-43-" class="def">(+)</a> :: a -> a -> a</p><p class="src"><a name="v:-42-" class="def">(*)</a> :: a -> a -> a</p><p class="src"><a name="v:-45-" class="def">(-)</a> :: a -> a -> a</p><p class="src"><a name="v:negate" class="def">negate</a> :: a -> a</p><div class="doc"><p>Unary negation. </p></div><p class="src"><a name="v:abs" class="def">abs</a> :: a -> a</p><div class="doc"><p>Absolute value. </p></div><p class="src"><a name="v:signum" class="def">signum</a> :: a -> a</p><div class="doc"><p>Sign of a number. The functions <code><a href="Prelude.html#v:abs">abs</a></code> and <code><a href="Prelude.html#v:signum">signum</a></code> should satisfy the law: </p><pre> abs x * signum x == x </pre><p>For real numbers, the <code><a href="Prelude.html#v:signum">signum</a></code> is either <code>-1</code> (negative), <code>0</code> (zero) or <code>1</code> (positive). </p></div><p class="src"><a name="v:fromInteger" class="def">fromInteger</a> :: <a href="Prelude.html#t:Integer">Integer</a> -> a</p><div class="doc"><p>Conversion from an <code><a href="Prelude.html#t:Integer">Integer</a></code>. An integer literal represents the application of the function <code><a href="Prelude.html#v:fromInteger">fromInteger</a></code> to the appropriate value of type <code><a href="Prelude.html#t:Integer">Integer</a></code>, so such literals have type <code>(<code><a href="Prelude.html#t:Num">Num</a></code> a) => a</code>. </p></div></div><div class="subs instances"><p id="control.i:Num" class="caption collapser" onclick="toggleSection('i:Num')">Instances</p><div id="section.i:Num" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Data-Int.html#t:Int8">Int8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Data-Int.html#t:Int16">Int16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Data-Int.html#t:Int32">Int32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Data-Int.html#t:Int64">Int64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Data-Word.html#t:Word">Word</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Data-Word.html#t:Word8">Word8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Data-Word.html#t:Word16">Word16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Data-Word.html#t:Word32">Word32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Data-Word.html#t:Word64">Word64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CUIntMax">CUIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CIntMax">CIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CUIntPtr">CUIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CIntPtr">CIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CTime">CTime</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CClock">CClock</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CSigAtomic">CSigAtomic</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CWchar">CWchar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CSize">CSize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CPtrdiff">CPtrdiff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CDouble">CDouble</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CFloat">CFloat</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CULLong">CULLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CLLong">CLLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CULong">CULong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CLong">CLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CUInt">CUInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CInt">CInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CUShort">CUShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CShort">CShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CUChar">CUChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CSChar">CSChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-C-Types.html#t:CChar">CChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-Ptr.html#t:IntPtr">IntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="Foreign-Ptr.html#t:WordPtr">WordPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="System-Posix-Types.html#t:Fd">Fd</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="System-Posix-Types.html#t:CRLim">CRLim</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="System-Posix-Types.html#t:CTcflag">CTcflag</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="System-Posix-Types.html#t:CSpeed">CSpeed</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="System-Posix-Types.html#t:CCc">CCc</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="System-Posix-Types.html#t:CUid">CUid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="System-Posix-Types.html#t:CNlink">CNlink</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="System-Posix-Types.html#t:CGid">CGid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="System-Posix-Types.html#t:CSsize">CSsize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="System-Posix-Types.html#t:CPid">CPid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="System-Posix-Types.html#t:COff">COff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="System-Posix-Types.html#t:CMode">CMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="System-Posix-Types.html#t:CIno">CIno</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> <a href="System-Posix-Types.html#t:CDev">CDev</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> EventType</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> Unique</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Num">Num</a> Event</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> a => <a href="Prelude.html#t:Num">Num</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:RealFloat">RealFloat</a> a => <a href="Prelude.html#t:Num">Num</a> (<a href="Data-Complex.html#t:Complex">Complex</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Fixed.html#t:HasResolution">HasResolution</a> a => <a href="Prelude.html#t:Num">Num</a> (<a href="Data-Fixed.html#t:Fixed">Fixed</a> a)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Prelude.html#t:Num">Num</a> a, <a href="Prelude.html#t:Ord">Ord</a> a) => <a name="t:Real" class="def">Real</a> a <span class="keyword">where</span></p><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:toRational" class="def">toRational</a> :: a -> <a href="Prelude.html#t:Rational">Rational</a></p><div class="doc"><p>the rational equivalent of its real argument with full precision </p></div></div><div class="subs instances"><p id="control.i:Real" class="caption collapser" onclick="toggleSection('i:Real')">Instances</p><div id="section.i:Real" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Data-Int.html#t:Int8">Int8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Data-Int.html#t:Int16">Int16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Data-Int.html#t:Int32">Int32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Data-Int.html#t:Int64">Int64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Data-Word.html#t:Word">Word</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Data-Word.html#t:Word8">Word8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Data-Word.html#t:Word16">Word16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Data-Word.html#t:Word32">Word32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Data-Word.html#t:Word64">Word64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CUIntMax">CUIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CIntMax">CIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CUIntPtr">CUIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CIntPtr">CIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CTime">CTime</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CClock">CClock</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CSigAtomic">CSigAtomic</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CWchar">CWchar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CSize">CSize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CPtrdiff">CPtrdiff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CDouble">CDouble</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CFloat">CFloat</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CULLong">CULLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CLLong">CLLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CULong">CULong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CLong">CLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CUInt">CUInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CInt">CInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CUShort">CUShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CShort">CShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CUChar">CUChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CSChar">CSChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-C-Types.html#t:CChar">CChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-Ptr.html#t:IntPtr">IntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="Foreign-Ptr.html#t:WordPtr">WordPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="System-Posix-Types.html#t:Fd">Fd</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="System-Posix-Types.html#t:CRLim">CRLim</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="System-Posix-Types.html#t:CTcflag">CTcflag</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="System-Posix-Types.html#t:CSpeed">CSpeed</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="System-Posix-Types.html#t:CCc">CCc</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="System-Posix-Types.html#t:CUid">CUid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="System-Posix-Types.html#t:CNlink">CNlink</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="System-Posix-Types.html#t:CGid">CGid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="System-Posix-Types.html#t:CSsize">CSsize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="System-Posix-Types.html#t:CPid">CPid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="System-Posix-Types.html#t:COff">COff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="System-Posix-Types.html#t:CMode">CMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="System-Posix-Types.html#t:CIno">CIno</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Real">Real</a> <a href="System-Posix-Types.html#t:CDev">CDev</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> a => <a href="Prelude.html#t:Real">Real</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Fixed.html#t:HasResolution">HasResolution</a> a => <a href="Prelude.html#t:Real">Real</a> (<a href="Data-Fixed.html#t:Fixed">Fixed</a> a)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Prelude.html#t:Real">Real</a> a, <a href="Prelude.html#t:Enum">Enum</a> a) => <a name="t:Integral" class="def">Integral</a> a <span class="keyword">where</span></p><div class="doc"><p>Integral numbers, supporting integer division. </p><p>Minimal complete definition: <code><a href="Prelude.html#v:quotRem">quotRem</a></code> and <code><a href="Prelude.html#v:toInteger">toInteger</a></code> </p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:quot" class="def">quot</a> :: a -> a -> a</p><div class="doc"><p>integer division truncated toward zero </p></div><p class="src"><a name="v:rem" class="def">rem</a> :: a -> a -> a</p><div class="doc"><p>integer remainder, satisfying </p><pre> (x `quot` y)*y + (x `rem` y) == x </pre></div><p class="src"><a name="v:div" class="def">div</a> :: a -> a -> a</p><div class="doc"><p>integer division truncated toward negative infinity </p></div><p class="src"><a name="v:mod" class="def">mod</a> :: a -> a -> a</p><div class="doc"><p>integer modulus, satisfying </p><pre> (x `div` y)*y + (x `mod` y) == x </pre></div><p class="src"><a name="v:quotRem" class="def">quotRem</a> :: a -> a -> (a, a)</p><div class="doc"><p>simultaneous <code><a href="Prelude.html#v:quot">quot</a></code> and <code><a href="Prelude.html#v:rem">rem</a></code> </p></div><p class="src"><a name="v:divMod" class="def">divMod</a> :: a -> a -> (a, a)</p><div class="doc"><p>simultaneous <code><a href="Prelude.html#v:div">div</a></code> and <code><a href="Prelude.html#v:mod">mod</a></code> </p></div><p class="src"><a name="v:toInteger" class="def">toInteger</a> :: a -> <a href="Prelude.html#t:Integer">Integer</a></p><div class="doc"><p>conversion to <code><a href="Prelude.html#t:Integer">Integer</a></code> </p></div></div><div class="subs instances"><p id="control.i:Integral" class="caption collapser" onclick="toggleSection('i:Integral')">Instances</p><div id="section.i:Integral" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Data-Int.html#t:Int8">Int8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Data-Int.html#t:Int16">Int16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Data-Int.html#t:Int32">Int32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Data-Int.html#t:Int64">Int64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Data-Word.html#t:Word">Word</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Data-Word.html#t:Word8">Word8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Data-Word.html#t:Word16">Word16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Data-Word.html#t:Word32">Word32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Data-Word.html#t:Word64">Word64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CUIntMax">CUIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CIntMax">CIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CUIntPtr">CUIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CIntPtr">CIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CSigAtomic">CSigAtomic</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CWchar">CWchar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CSize">CSize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CPtrdiff">CPtrdiff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CULLong">CULLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CLLong">CLLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CULong">CULong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CLong">CLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CUInt">CUInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CInt">CInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CUShort">CUShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CShort">CShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CUChar">CUChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CSChar">CSChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-C-Types.html#t:CChar">CChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-Ptr.html#t:IntPtr">IntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="Foreign-Ptr.html#t:WordPtr">WordPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="System-Posix-Types.html#t:Fd">Fd</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="System-Posix-Types.html#t:CRLim">CRLim</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="System-Posix-Types.html#t:CTcflag">CTcflag</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="System-Posix-Types.html#t:CUid">CUid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="System-Posix-Types.html#t:CNlink">CNlink</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="System-Posix-Types.html#t:CGid">CGid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="System-Posix-Types.html#t:CSsize">CSsize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="System-Posix-Types.html#t:CPid">CPid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="System-Posix-Types.html#t:COff">COff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="System-Posix-Types.html#t:CMode">CMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> <a href="System-Posix-Types.html#t:CIno">CIno</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a href="Prelude.html#t:Num">Num</a> a => <a name="t:Fractional" class="def">Fractional</a> a <span class="keyword">where</span></p><div class="doc"><p>Fractional numbers, supporting real division. </p><p>Minimal complete definition: <code><a href="Prelude.html#v:fromRational">fromRational</a></code> and (<code><a href="Prelude.html#v:recip">recip</a></code> or <code>(<code><a href="Prelude.html#v:-47-">/</a></code>)</code>) </p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:-47-" class="def">(/)</a> :: a -> a -> a</p><div class="doc"><p>fractional division </p></div><p class="src"><a name="v:recip" class="def">recip</a> :: a -> a</p><div class="doc"><p>reciprocal fraction </p></div><p class="src"><a name="v:fromRational" class="def">fromRational</a> :: <a href="Prelude.html#t:Rational">Rational</a> -> a</p><div class="doc"><p>Conversion from a <code><a href="Prelude.html#t:Rational">Rational</a></code> (that is <code><code><a href="Data-Ratio.html#t:Ratio">Ratio</a></code> <code><a href="Prelude.html#t:Integer">Integer</a></code></code>). A floating literal stands for an application of <code><a href="Prelude.html#v:fromRational">fromRational</a></code> to a value of type <code><a href="Prelude.html#t:Rational">Rational</a></code>, so such literals have type <code>(<code><a href="Prelude.html#t:Fractional">Fractional</a></code> a) => a</code>. </p></div></div><div class="subs instances"><p id="control.i:Fractional" class="caption collapser" onclick="toggleSection('i:Fractional')">Instances</p><div id="section.i:Fractional" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Fractional">Fractional</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Fractional">Fractional</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Fractional">Fractional</a> <a href="Foreign-C-Types.html#t:CDouble">CDouble</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Fractional">Fractional</a> <a href="Foreign-C-Types.html#t:CFloat">CFloat</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> a => <a href="Prelude.html#t:Fractional">Fractional</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:RealFloat">RealFloat</a> a => <a href="Prelude.html#t:Fractional">Fractional</a> (<a href="Data-Complex.html#t:Complex">Complex</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Fixed.html#t:HasResolution">HasResolution</a> a => <a href="Prelude.html#t:Fractional">Fractional</a> (<a href="Data-Fixed.html#t:Fixed">Fixed</a> a)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a href="Prelude.html#t:Fractional">Fractional</a> a => <a name="t:Floating" class="def">Floating</a> a <span class="keyword">where</span></p><div class="doc"><p>Trigonometric and hyperbolic functions and related functions. </p><p>Minimal complete definition: <code><a href="Prelude.html#v:pi">pi</a></code>, <code><a href="Prelude.html#v:exp">exp</a></code>, <code><a href="Prelude.html#v:log">log</a></code>, <code><a href="Prelude.html#v:sin">sin</a></code>, <code><a href="Prelude.html#v:cos">cos</a></code>, <code><a href="Prelude.html#v:sinh">sinh</a></code>, <code><a href="Prelude.html#v:cosh">cosh</a></code>, <code><a href="Prelude.html#v:asin">asin</a></code>, <code><a href="Prelude.html#v:acos">acos</a></code>, <code><a href="Prelude.html#v:atan">atan</a></code>, <code><a href="Prelude.html#v:asinh">asinh</a></code>, <code><a href="Prelude.html#v:acosh">acosh</a></code> and <code><a href="Prelude.html#v:atanh">atanh</a></code> </p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:pi" class="def">pi</a> :: a</p><p class="src"><a name="v:exp" class="def">exp</a> :: a -> a</p><p class="src"><a name="v:sqrt" class="def">sqrt</a> :: a -> a</p><p class="src"><a name="v:log" class="def">log</a> :: a -> a</p><p class="src"><a name="v:-42--42-" class="def">(**)</a> :: a -> a -> a</p><p class="src"><a name="v:logBase" class="def">logBase</a> :: a -> a -> a</p><p class="src"><a name="v:sin" class="def">sin</a> :: a -> a</p><p class="src"><a name="v:tan" class="def">tan</a> :: a -> a</p><p class="src"><a name="v:cos" class="def">cos</a> :: a -> a</p><p class="src"><a name="v:asin" class="def">asin</a> :: a -> a</p><p class="src"><a name="v:atan" class="def">atan</a> :: a -> a</p><p class="src"><a name="v:acos" class="def">acos</a> :: a -> a</p><p class="src"><a name="v:sinh" class="def">sinh</a> :: a -> a</p><p class="src"><a name="v:tanh" class="def">tanh</a> :: a -> a</p><p class="src"><a name="v:cosh" class="def">cosh</a> :: a -> a</p><p class="src"><a name="v:asinh" class="def">asinh</a> :: a -> a</p><p class="src"><a name="v:atanh" class="def">atanh</a> :: a -> a</p><p class="src"><a name="v:acosh" class="def">acosh</a> :: a -> a</p></div><div class="subs instances"><p id="control.i:Floating" class="caption collapser" onclick="toggleSection('i:Floating')">Instances</p><div id="section.i:Floating" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Floating">Floating</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Floating">Floating</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Floating">Floating</a> <a href="Foreign-C-Types.html#t:CDouble">CDouble</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Floating">Floating</a> <a href="Foreign-C-Types.html#t:CFloat">CFloat</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:RealFloat">RealFloat</a> a => <a href="Prelude.html#t:Floating">Floating</a> (<a href="Data-Complex.html#t:Complex">Complex</a> a)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Prelude.html#t:Real">Real</a> a, <a href="Prelude.html#t:Fractional">Fractional</a> a) => <a name="t:RealFrac" class="def">RealFrac</a> a <span class="keyword">where</span></p><div class="doc"><p>Extracting components of fractions. </p><p>Minimal complete definition: <code><a href="Prelude.html#v:properFraction">properFraction</a></code> </p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:properFraction" class="def">properFraction</a> :: <a href="Prelude.html#t:Integral">Integral</a> b => a -> (b, a)</p><div class="doc"><p>The function <code><a href="Prelude.html#v:properFraction">properFraction</a></code> takes a real fractional number <code>x</code> and returns a pair <code>(n,f)</code> such that <code>x = n+f</code>, and: </p><ul><li> <code>n</code> is an integral number with the same sign as <code>x</code>; and </li><li> <code>f</code> is a fraction with the same type and sign as <code>x</code>, and with absolute value less than <code>1</code>. </li></ul><p>The default definitions of the <code><a href="Prelude.html#v:ceiling">ceiling</a></code>, <code><a href="Prelude.html#v:floor">floor</a></code>, <code><a href="Prelude.html#v:truncate">truncate</a></code> and <code><a href="Prelude.html#v:round">round</a></code> functions are in terms of <code><a href="Prelude.html#v:properFraction">properFraction</a></code>. </p></div><p class="src"><a name="v:truncate" class="def">truncate</a> :: <a href="Prelude.html#t:Integral">Integral</a> b => a -> b</p><div class="doc"><p><code><code><a href="Prelude.html#v:truncate">truncate</a></code> x</code> returns the integer nearest <code>x</code> between zero and <code>x</code> </p></div><p class="src"><a name="v:round" class="def">round</a> :: <a href="Prelude.html#t:Integral">Integral</a> b => a -> b</p><div class="doc"><p><code><code><a href="Prelude.html#v:round">round</a></code> x</code> returns the nearest integer to <code>x</code>; the even integer if <code>x</code> is equidistant between two integers </p></div><p class="src"><a name="v:ceiling" class="def">ceiling</a> :: <a href="Prelude.html#t:Integral">Integral</a> b => a -> b</p><div class="doc"><p><code><code><a href="Prelude.html#v:ceiling">ceiling</a></code> x</code> returns the least integer not less than <code>x</code> </p></div><p class="src"><a name="v:floor" class="def">floor</a> :: <a href="Prelude.html#t:Integral">Integral</a> b => a -> b</p><div class="doc"><p><code><code><a href="Prelude.html#v:floor">floor</a></code> x</code> returns the greatest integer not greater than <code>x</code> </p></div></div><div class="subs instances"><p id="control.i:RealFrac" class="caption collapser" onclick="toggleSection('i:RealFrac')">Instances</p><div id="section.i:RealFrac" class="show"><table><tr><td class="src"><a href="Prelude.html#t:RealFrac">RealFrac</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:RealFrac">RealFrac</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:RealFrac">RealFrac</a> <a href="Foreign-C-Types.html#t:CDouble">CDouble</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:RealFrac">RealFrac</a> <a href="Foreign-C-Types.html#t:CFloat">CFloat</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> a => <a href="Prelude.html#t:RealFrac">RealFrac</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Fixed.html#t:HasResolution">HasResolution</a> a => <a href="Prelude.html#t:RealFrac">RealFrac</a> (<a href="Data-Fixed.html#t:Fixed">Fixed</a> a)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Prelude.html#t:RealFrac">RealFrac</a> a, <a href="Prelude.html#t:Floating">Floating</a> a) => <a name="t:RealFloat" class="def">RealFloat</a> a <span class="keyword">where</span></p><div class="doc"><p>Efficient, machine-independent access to the components of a floating-point number. </p><p>Minimal complete definition: all except <code><a href="Prelude.html#v:exponent">exponent</a></code>, <code><a href="Prelude.html#v:significand">significand</a></code>, <code><a href="Prelude.html#v:scaleFloat">scaleFloat</a></code> and <code><a href="Prelude.html#v:atan2">atan2</a></code> </p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:floatRadix" class="def">floatRadix</a> :: a -> <a href="Prelude.html#t:Integer">Integer</a></p><div class="doc"><p>a constant function, returning the radix of the representation (often <code>2</code>) </p></div><p class="src"><a name="v:floatDigits" class="def">floatDigits</a> :: a -> <a href="Prelude.html#t:Int">Int</a></p><div class="doc"><p>a constant function, returning the number of digits of <code><a href="Prelude.html#v:floatRadix">floatRadix</a></code> in the significand </p></div><p class="src"><a name="v:floatRange" class="def">floatRange</a> :: a -> (<a href="Prelude.html#t:Int">Int</a>, <a href="Prelude.html#t:Int">Int</a>)</p><div class="doc"><p>a constant function, returning the lowest and highest values the exponent may assume </p></div><p class="src"><a name="v:decodeFloat" class="def">decodeFloat</a> :: a -> (<a href="Prelude.html#t:Integer">Integer</a>, <a href="Prelude.html#t:Int">Int</a>)</p><div class="doc"><p>The function <code><a href="Prelude.html#v:decodeFloat">decodeFloat</a></code> applied to a real floating-point number returns the significand expressed as an <code><a href="Prelude.html#t:Integer">Integer</a></code> and an appropriately scaled exponent (an <code><a href="Prelude.html#t:Int">Int</a></code>). If <code><code><a href="Prelude.html#v:decodeFloat">decodeFloat</a></code> x</code> yields <code>(m,n)</code>, then <code>x</code> is equal in value to <code>m*b^^n</code>, where <code>b</code> is the floating-point radix, and furthermore, either <code>m</code> and <code>n</code> are both zero or else <code>b^(d-1) <= m < b^d</code>, where <code>d</code> is the value of <code><code><a href="Prelude.html#v:floatDigits">floatDigits</a></code> x</code>. In particular, <code><code><a href="Prelude.html#v:decodeFloat">decodeFloat</a></code> 0 = (0,0)</code>. </p></div><p class="src"><a name="v:encodeFloat" class="def">encodeFloat</a> :: <a href="Prelude.html#t:Integer">Integer</a> -> <a href="Prelude.html#t:Int">Int</a> -> a</p><div class="doc"><p><code><a href="Prelude.html#v:encodeFloat">encodeFloat</a></code> performs the inverse of <code><a href="Prelude.html#v:decodeFloat">decodeFloat</a></code> </p></div><p class="src"><a name="v:exponent" class="def">exponent</a> :: a -> <a href="Prelude.html#t:Int">Int</a></p><div class="doc"><p>the second component of <code><a href="Prelude.html#v:decodeFloat">decodeFloat</a></code>. </p></div><p class="src"><a name="v:significand" class="def">significand</a> :: a -> a</p><div class="doc"><p>the first component of <code><a href="Prelude.html#v:decodeFloat">decodeFloat</a></code>, scaled to lie in the open interval (<code>-1</code>,<code>1</code>) </p></div><p class="src"><a name="v:scaleFloat" class="def">scaleFloat</a> :: <a href="Prelude.html#t:Int">Int</a> -> a -> a</p><div class="doc"><p>multiplies a floating-point number by an integer power of the radix </p></div><p class="src"><a name="v:isNaN" class="def">isNaN</a> :: a -> <a href="Prelude.html#t:Bool">Bool</a></p><div class="doc"><p><code><a href="Prelude.html#v:True">True</a></code> if the argument is an IEEE "not-a-number" (NaN) value </p></div><p class="src"><a name="v:isInfinite" class="def">isInfinite</a> :: a -> <a href="Prelude.html#t:Bool">Bool</a></p><div class="doc"><p><code><a href="Prelude.html#v:True">True</a></code> if the argument is an IEEE infinity or negative infinity </p></div><p class="src"><a name="v:isDenormalized" class="def">isDenormalized</a> :: a -> <a href="Prelude.html#t:Bool">Bool</a></p><div class="doc"><p><code><a href="Prelude.html#v:True">True</a></code> if the argument is too small to be represented in normalized format </p></div><p class="src"><a name="v:isNegativeZero" class="def">isNegativeZero</a> :: a -> <a href="Prelude.html#t:Bool">Bool</a></p><div class="doc"><p><code><a href="Prelude.html#v:True">True</a></code> if the argument is an IEEE negative zero </p></div><p class="src"><a name="v:isIEEE" class="def">isIEEE</a> :: a -> <a href="Prelude.html#t:Bool">Bool</a></p><div class="doc"><p><code><a href="Prelude.html#v:True">True</a></code> if the argument is an IEEE floating point number </p></div><p class="src"><a name="v:atan2" class="def">atan2</a> :: a -> a -> a</p><div class="doc"><p>a version of arctangent taking two real floating-point arguments. For real floating <code>x</code> and <code>y</code>, <code><code><a href="Prelude.html#v:atan2">atan2</a></code> y x</code> computes the angle (from the positive x-axis) of the vector from the origin to the point <code>(x,y)</code>. <code><code><a href="Prelude.html#v:atan2">atan2</a></code> y x</code> returns a value in the range [<code>-pi</code>, <code>pi</code>]. It follows the Common Lisp semantics for the origin when signed zeroes are supported. <code><code><a href="Prelude.html#v:atan2">atan2</a></code> y 1</code>, with <code>y</code> in a type that is <code><a href="Prelude.html#t:RealFloat">RealFloat</a></code>, should return the same value as <code><code><a href="Prelude.html#v:atan">atan</a></code> y</code>. A default definition of <code><a href="Prelude.html#v:atan2">atan2</a></code> is provided, but implementors can provide a more accurate implementation. </p></div></div><div class="subs instances"><p id="control.i:RealFloat" class="caption collapser" onclick="toggleSection('i:RealFloat')">Instances</p><div id="section.i:RealFloat" class="show"><table><tr><td class="src"><a href="Prelude.html#t:RealFloat">RealFloat</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:RealFloat">RealFloat</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:RealFloat">RealFloat</a> <a href="Foreign-C-Types.html#t:CDouble">CDouble</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:RealFloat">RealFloat</a> <a href="Foreign-C-Types.html#t:CFloat">CFloat</a></td><td class="doc empty"> </td></tr></table></div></div></div><h3 id="g:8">Numeric functions </h3><div class="top"><p class="src"><a name="v:subtract" class="def">subtract</a> :: <a href="Prelude.html#t:Num">Num</a> a => a -> a -> a</p><div class="doc"><p>the same as <code><code><a href="Prelude.html#v:flip">flip</a></code> (<code><a href="Prelude.html#v:-45-">-</a></code>)</code>. </p><p>Because <code>-</code> is treated specially in the Haskell grammar, <code>(-</code> <em>e</em><code>)</code> is not a section, but an application of prefix negation. However, <code>(<code><a href="Prelude.html#v:subtract">subtract</a></code></code> <em>exp</em><code>)</code> is equivalent to the disallowed section. </p></div></div><div class="top"><p class="src"><a name="v:even" class="def">even</a> :: <a href="Prelude.html#t:Integral">Integral</a> a => a -> <a href="Prelude.html#t:Bool">Bool</a></p></div><div class="top"><p class="src"><a name="v:odd" class="def">odd</a> :: <a href="Prelude.html#t:Integral">Integral</a> a => a -> <a href="Prelude.html#t:Bool">Bool</a></p></div><div class="top"><p class="src"><a name="v:gcd" class="def">gcd</a> :: <a href="Prelude.html#t:Integral">Integral</a> a => a -> a -> a</p><div class="doc"><p><code><code><a href="Prelude.html#v:gcd">gcd</a></code> x y</code> is the greatest (positive) integer that divides both <code>x</code> and <code>y</code>; for example <code><code><a href="Prelude.html#v:gcd">gcd</a></code> (-3) 6</code> = <code>3</code>, <code><code><a href="Prelude.html#v:gcd">gcd</a></code> (-3) (-6)</code> = <code>3</code>, <code><code><a href="Prelude.html#v:gcd">gcd</a></code> 0 4</code> = <code>4</code>. <code><code><a href="Prelude.html#v:gcd">gcd</a></code> 0 0</code> raises a runtime error. </p></div></div><div class="top"><p class="src"><a name="v:lcm" class="def">lcm</a> :: <a href="Prelude.html#t:Integral">Integral</a> a => a -> a -> a</p><div class="doc"><p><code><code><a href="Prelude.html#v:lcm">lcm</a></code> x y</code> is the smallest positive integer that both <code>x</code> and <code>y</code> divide. </p></div></div><div class="top"><p class="src"><a name="v:-94-" class="def">(^)</a> :: (<a href="Prelude.html#t:Num">Num</a> a, <a href="Prelude.html#t:Integral">Integral</a> b) => a -> b -> a</p><div class="doc"><p>raise a number to a non-negative integral power </p></div></div><div class="top"><p class="src"><a name="v:-94--94-" class="def">(^^)</a> :: (<a href="Prelude.html#t:Fractional">Fractional</a> a, <a href="Prelude.html#t:Integral">Integral</a> b) => a -> b -> a</p><div class="doc"><p>raise a number to an integral power </p></div></div><div class="top"><p class="src"><a name="v:fromIntegral" class="def">fromIntegral</a> :: (<a href="Prelude.html#t:Integral">Integral</a> a, <a href="Prelude.html#t:Num">Num</a> b) => a -> b</p><div class="doc"><p>general coercion from integral types </p></div></div><div class="top"><p class="src"><a name="v:realToFrac" class="def">realToFrac</a> :: (<a href="Prelude.html#t:Real">Real</a> a, <a href="Prelude.html#t:Fractional">Fractional</a> b) => a -> b</p><div class="doc"><p>general coercion to fractional types </p></div></div><h2 id="g:9">Monads and functors </h2><div class="top"><p class="src"><span class="keyword">class</span> <a name="t:Monad" class="def">Monad</a> m <span class="keyword">where</span></p><div class="doc"><p>The <code><a href="Prelude.html#t:Monad">Monad</a></code> class defines the basic operations over a <em>monad</em>, a concept from a branch of mathematics known as <em>category theory</em>. From the perspective of a Haskell programmer, however, it is best to think of a monad as an <em>abstract datatype</em> of actions. Haskell's <code>do</code> expressions provide a convenient syntax for writing monadic expressions. </p><p>Minimal complete definition: <code><a href="Prelude.html#v:-62--62--61-">>>=</a></code> and <code><a href="Prelude.html#v:return">return</a></code>. </p><p>Instances of <code><a href="Prelude.html#t:Monad">Monad</a></code> should satisfy the following laws: </p><pre> return a >>= k == k a m >>= return == m m >>= (\x -> k x >>= h) == (m >>= k) >>= h </pre><p>Instances of both <code><a href="Prelude.html#t:Monad">Monad</a></code> and <code><a href="Prelude.html#t:Functor">Functor</a></code> should additionally satisfy the law: </p><pre> fmap f xs == xs >>= return . f </pre><p>The instances of <code><a href="Prelude.html#t:Monad">Monad</a></code> for lists, <code>Data.Maybe.Maybe</code> and <code>System.IO.IO</code> defined in the <a href="Prelude.html">Prelude</a> satisfy these laws. </p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:-62--62--61-" class="def">(>>=)</a> :: <span class="keyword">forall</span> a b. m a -> (a -> m b) -> m b</p><div class="doc"><p>Sequentially compose two actions, passing any value produced by the first as an argument to the second. </p></div><p class="src"><a name="v:-62--62-" class="def">(>>)</a> :: <span class="keyword">forall</span> a b. m a -> m b -> m b</p><div class="doc"><p>Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages. </p></div><p class="src"><a name="v:return" class="def">return</a> :: a -> m a</p><div class="doc"><p>Inject a value into the monadic type. </p></div><p class="src"><a name="v:fail" class="def">fail</a> :: <a href="Prelude.html#t:String">String</a> -> m a</p><div class="doc"><p>Fail with a message. This operation is not part of the mathematical definition of a monad, but is invoked on pattern-match failure in a <code>do</code> expression. </p></div></div><div class="subs instances"><p id="control.i:Monad" class="caption collapser" onclick="toggleSection('i:Monad')">Instances</p><div id="section.i:Monad" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Monad">Monad</a> []</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Monad">Monad</a> <a href="Prelude.html#t:IO">IO</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Monad">Monad</a> [::]</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Monad">Monad</a> <a href="Prelude.html#t:Maybe">Maybe</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Monad">Monad</a> <a href="Text-ParserCombinators-ReadP.html#t:ReadP">ReadP</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Monad">Monad</a> P</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Monad">Monad</a> <a href="Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Monad">Monad</a> <a href="GHC-Conc.html#t:STM">STM</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Monad">Monad</a> ((->) r)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Monad">Monad</a> (<a href="Prelude.html#t:Either">Either</a> e)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Monad">Monad</a> (<a href="Control-Monad-ST.html#t:ST">ST</a> s)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Arrow.html#t:ArrowApply">ArrowApply</a> a => <a href="Prelude.html#t:Monad">Monad</a> (<a href="Control-Arrow.html#t:ArrowMonad">ArrowMonad</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Monad">Monad</a> (<a href="Control-Monad-ST-Lazy.html#t:ST">ST</a> s)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a name="t:Functor" class="def">Functor</a> f <span class="keyword">where</span></p><div class="doc"><p>The <code><a href="Prelude.html#t:Functor">Functor</a></code> class is used for types that can be mapped over. Instances of <code><a href="Prelude.html#t:Functor">Functor</a></code> should satisfy the following laws: </p><pre> fmap id == id fmap (f . g) == fmap f . fmap g </pre><p>The instances of <code><a href="Prelude.html#t:Functor">Functor</a></code> for lists, <code>Data.Maybe.Maybe</code> and <code>System.IO.IO</code> satisfy these laws. </p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:fmap" class="def">fmap</a> :: (a -> b) -> f a -> f b</p></div><div class="subs instances"><p id="control.i:Functor" class="caption collapser" onclick="toggleSection('i:Functor')">Instances</p><div id="section.i:Functor" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> []</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> <a href="Prelude.html#t:IO">IO</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> [::]</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> <a href="Prelude.html#t:Maybe">Maybe</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> <a href="Text-ParserCombinators-ReadP.html#t:ReadP">ReadP</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> <a href="Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> <a href="GHC-Conc.html#t:STM">STM</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> <a href="Control-Applicative.html#t:ZipList">ZipList</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> Id</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> ((->) r)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> (<a href="Prelude.html#t:Either">Either</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> (<a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> (<a href="Control-Monad-ST.html#t:ST">ST</a> s)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Ix.html#t:Ix">Ix</a> i => <a href="Prelude.html#t:Functor">Functor</a> (Array i)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Monad">Monad</a> m => <a href="Prelude.html#t:Functor">Functor</a> (<a href="Control-Applicative.html#t:WrappedMonad">WrappedMonad</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> (<a href="Control-Applicative.html#t:Const">Const</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> (StateR s)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> (StateL s)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> (<a href="Control-Monad-ST-Lazy.html#t:ST">ST</a> s)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Arrow.html#t:Arrow">Arrow</a> a => <a href="Prelude.html#t:Functor">Functor</a> (<a href="Control-Applicative.html#t:WrappedArrow">WrappedArrow</a> a b)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:mapM" class="def">mapM</a> :: <a href="Prelude.html#t:Monad">Monad</a> m => (a -> m b) -> [a] -> m [b]</p><div class="doc"><p><code><code><a href="Prelude.html#v:mapM">mapM</a></code> f</code> is equivalent to <code><code><a href="Prelude.html#v:sequence">sequence</a></code> . <code><a href="Prelude.html#v:map">map</a></code> f</code>. </p></div></div><div class="top"><p class="src"><a name="v:mapM_" class="def">mapM_</a> :: <a href="Prelude.html#t:Monad">Monad</a> m => (a -> m b) -> [a] -> m <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></p><div class="doc"><p><code><code><a href="Prelude.html#v:mapM_">mapM_</a></code> f</code> is equivalent to <code><code><a href="Prelude.html#v:sequence_">sequence_</a></code> . <code><a href="Prelude.html#v:map">map</a></code> f</code>. </p></div></div><div class="top"><p class="src"><a name="v:sequence" class="def">sequence</a> :: <a href="Prelude.html#t:Monad">Monad</a> m => [m a] -> m [a]</p><div class="doc"><p>Evaluate each action in the sequence from left to right, and collect the results. </p></div></div><div class="top"><p class="src"><a name="v:sequence_" class="def">sequence_</a> :: <a href="Prelude.html#t:Monad">Monad</a> m => [m a] -> m <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></p><div class="doc"><p>Evaluate each action in the sequence from left to right, and ignore the results. </p></div></div><div class="top"><p class="src"><a name="v:-61--60--60-" class="def">(=<<)</a> :: <a href="Prelude.html#t:Monad">Monad</a> m => (a -> m b) -> m a -> m b</p><div class="doc"><p>Same as <code><a href="Prelude.html#v:-62--62--61-">>>=</a></code>, but with the arguments interchanged. </p></div></div><h2 id="g:10">Miscellaneous functions </h2><div class="top"><p class="src"><a name="v:id" class="def">id</a> :: a -> 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 -> b -> a</p><div class="doc"><p>Constant function. </p></div></div><div class="top"><p class="src"><a name="v:." class="def">(.)</a> :: (b -> c) -> (a -> b) -> a -> 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 -> b -> c) -> b -> a -> c</p><div class="doc"><p><code><code><a href="Prelude.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 -> b) -> a -> 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="Prelude.html#v:-36-">$</a></code> x)</code>. However, <code><a href="Prelude.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="Prelude.html#v:map">map</a></code> (<code><a href="Prelude.html#v:-36-">$</a></code> 0) xs</code>, or <code><code>Data.List.zipWith</code> (<code><a href="Prelude.html#v:-36-">$</a></code>) fs xs</code>. </p></div></div><div class="top"><p class="src"><a name="v:until" class="def">until</a> :: (a -> <a href="Prelude.html#t:Bool">Bool</a>) -> (a -> a) -> a -> a</p><div class="doc"><p><code><code><a href="Prelude.html#v:until">until</a></code> p f</code> yields the result of applying <code>f</code> until <code>p</code> holds. </p></div></div><div class="top"><p class="src"><a name="v:asTypeOf" class="def">asTypeOf</a> :: a -> a -> a</p><div class="doc"><p><code><a href="Prelude.html#v:asTypeOf">asTypeOf</a></code> is a type-restricted version of <code><a href="Prelude.html#v:const">const</a></code>. It is usually used as an infix operator, and its typing forces its first argument (which is usually overloaded) to have the same type as the second. </p></div></div><div class="top"><p class="src"><a name="v:error" class="def">error</a> :: [<a href="Prelude.html#t:Char">Char</a>] -> a</p><div class="doc"><p><code><a href="Prelude.html#v:error">error</a></code> stops execution and displays an error message. </p></div></div><div class="top"><p class="src"><a name="v:undefined" class="def">undefined</a> :: a</p><div class="doc"><p>A special case of <code><a href="Prelude.html#v:error">error</a></code>. It is expected that compilers will recognize this and insert error messages which are more appropriate to the context in which <code><a href="Prelude.html#v:undefined">undefined</a></code> appears. </p></div></div><div class="top"><p class="src"><a name="v:seq" class="def">seq</a> :: a -> b -> b<a href="../ghc-prim-0.2.0.0/src/GHC-Prim.html#seq" class="link">Source</a></p><div class="doc"><p>Evaluates its first argument to head normal form, and then returns its second argument as the result. </p></div></div><div class="top"><p class="src"><a name="v:-36--33-" class="def">($!)</a> :: (a -> b) -> a -> b</p><div class="doc"><p>Strict (call-by-value) application, defined in terms of <code><a href="Prelude.html#v:seq">seq</a></code>. </p></div></div><h1 id="g:11">List operations </h1><div class="top"><p class="src"><a name="v:map" class="def">map</a> :: (a -> b) -> [a] -> [b]</p><div class="doc"><p><code><a href="Prelude.html#v:map">map</a></code> <code>f xs</code> is the list obtained by applying <code>f</code> to each element of <code>xs</code>, i.e., </p><pre> map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn] map f [x1, x2, ...] == [f x1, f x2, ...] </pre></div></div><div class="top"><p class="src"><a name="v:-43--43-" class="def">(++)</a> :: [a] -> [a] -> [a]</p><div class="doc"><p>Append two lists, i.e., </p><pre> [x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn] [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...] </pre><p>If the first list is not finite, the result is the first list. </p></div></div><div class="top"><p class="src"><a name="v:filter" class="def">filter</a> :: (a -> <a href="Prelude.html#t:Bool">Bool</a>) -> [a] -> [a]</p><div class="doc"><p><code><a href="Prelude.html#v:filter">filter</a></code>, applied to a predicate and a list, returns the list of those elements that satisfy the predicate; i.e., </p><pre> filter p xs = [ x | x <- xs, p x] </pre></div></div><div class="top"><p class="src"><a name="v:head" class="def">head</a> :: [a] -> a</p><div class="doc"><p>Extract the first element of a list, which must be non-empty. </p></div></div><div class="top"><p class="src"><a name="v:last" class="def">last</a> :: [a] -> a</p><div class="doc"><p>Extract the last element of a list, which must be finite and non-empty. </p></div></div><div class="top"><p class="src"><a name="v:tail" class="def">tail</a> :: [a] -> [a]</p><div class="doc"><p>Extract the elements after the head of a list, which must be non-empty. </p></div></div><div class="top"><p class="src"><a name="v:init" class="def">init</a> :: [a] -> [a]</p><div class="doc"><p>Return all the elements of a list except the last one. The list must be non-empty. </p></div></div><div class="top"><p class="src"><a name="v:null" class="def">null</a> :: [a] -> <a href="Prelude.html#t:Bool">Bool</a></p><div class="doc"><p>Test whether a list is empty. </p></div></div><div class="top"><p class="src"><a name="v:length" class="def">length</a> :: [a] -> <a href="Prelude.html#t:Int">Int</a></p><div class="doc"><p><em>O(n)</em>. <code><a href="Prelude.html#v:length">length</a></code> returns the length of a finite list as an <code><a href="Prelude.html#t:Int">Int</a></code>. It is an instance of the more general <code>Data.List.genericLength</code>, the result type of which may be any kind of number. </p></div></div><div class="top"><p class="src"><a name="v:-33--33-" class="def">(!!)</a> :: [a] -> <a href="Prelude.html#t:Int">Int</a> -> a</p><div class="doc"><p>List index (subscript) operator, starting from 0. It is an instance of the more general <code>Data.List.genericIndex</code>, which takes an index of any integral type. </p></div></div><div class="top"><p class="src"><a name="v:reverse" class="def">reverse</a> :: [a] -> [a]</p><div class="doc"><p><code><a href="Prelude.html#v:reverse">reverse</a></code> <code>xs</code> returns the elements of <code>xs</code> in reverse order. <code>xs</code> must be finite. </p></div></div><h2 id="g:12">Reducing lists (folds) </h2><div class="top"><p class="src"><a name="v:foldl" class="def">foldl</a> :: (a -> b -> a) -> a -> [b] -> a</p><div class="doc"><p><code><a href="Prelude.html#v:foldl">foldl</a></code>, applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right: </p><pre> foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn </pre><p>The list must be finite. </p></div></div><div class="top"><p class="src"><a name="v:foldl1" class="def">foldl1</a> :: (a -> a -> a) -> [a] -> a</p><div class="doc"><p><code><a href="Prelude.html#v:foldl1">foldl1</a></code> is a variant of <code><a href="Prelude.html#v:foldl">foldl</a></code> that has no starting value argument, and thus must be applied to non-empty lists. </p></div></div><div class="top"><p class="src"><a name="v:foldr" class="def">foldr</a> :: (a -> b -> b) -> b -> [a] -> b</p><div class="doc"><p><code><a href="Prelude.html#v:foldr">foldr</a></code>, applied to a binary operator, a starting value (typically the right-identity of the operator), and a list, reduces the list using the binary operator, from right to left: </p><pre> foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...) </pre></div></div><div class="top"><p class="src"><a name="v:foldr1" class="def">foldr1</a> :: (a -> a -> a) -> [a] -> a</p><div class="doc"><p><code><a href="Prelude.html#v:foldr1">foldr1</a></code> is a variant of <code><a href="Prelude.html#v:foldr">foldr</a></code> that has no starting value argument, and thus must be applied to non-empty lists. </p></div></div><h3 id="g:13">Special folds </h3><div class="top"><p class="src"><a name="v:and" class="def">and</a> :: [<a href="Prelude.html#t:Bool">Bool</a>] -> <a href="Prelude.html#t:Bool">Bool</a></p><div class="doc"><p><code><a href="Prelude.html#v:and">and</a></code> returns the conjunction of a Boolean list. For the result to be <code><a href="Prelude.html#v:True">True</a></code>, the list must be finite; <code><a href="Prelude.html#v:False">False</a></code>, however, results from a <code><a href="Prelude.html#v:False">False</a></code> value at a finite index of a finite or infinite list. </p></div></div><div class="top"><p class="src"><a name="v:or" class="def">or</a> :: [<a href="Prelude.html#t:Bool">Bool</a>] -> <a href="Prelude.html#t:Bool">Bool</a></p><div class="doc"><p><code><a href="Prelude.html#v:or">or</a></code> returns the disjunction of a Boolean list. For the result to be <code><a href="Prelude.html#v:False">False</a></code>, the list must be finite; <code><a href="Prelude.html#v:True">True</a></code>, however, results from a <code><a href="Prelude.html#v:True">True</a></code> value at a finite index of a finite or infinite list. </p></div></div><div class="top"><p class="src"><a name="v:any" class="def">any</a> :: (a -> <a href="Prelude.html#t:Bool">Bool</a>) -> [a] -> <a href="Prelude.html#t:Bool">Bool</a></p><div class="doc"><p>Applied to a predicate and a list, <code><a href="Prelude.html#v:any">any</a></code> determines if any element of the list satisfies the predicate. For the result to be <code><a href="Prelude.html#v:False">False</a></code>, the list must be finite; <code><a href="Prelude.html#v:True">True</a></code>, however, results from a <code><a href="Prelude.html#v:True">True</a></code> value for the predicate applied to an element at a finite index of a finite or infinite list. </p></div></div><div class="top"><p class="src"><a name="v:all" class="def">all</a> :: (a -> <a href="Prelude.html#t:Bool">Bool</a>) -> [a] -> <a href="Prelude.html#t:Bool">Bool</a></p><div class="doc"><p>Applied to a predicate and a list, <code><a href="Prelude.html#v:all">all</a></code> determines if all elements of the list satisfy the predicate. For the result to be <code><a href="Prelude.html#v:True">True</a></code>, the list must be finite; <code><a href="Prelude.html#v:False">False</a></code>, however, results from a <code><a href="Prelude.html#v:False">False</a></code> value for the predicate applied to an element at a finite index of a finite or infinite list. </p></div></div><div class="top"><p class="src"><a name="v:sum" class="def">sum</a> :: <a href="Prelude.html#t:Num">Num</a> a => [a] -> a</p><div class="doc"><p>The <code><a href="Prelude.html#v:sum">sum</a></code> function computes the sum of a finite list of numbers. </p></div></div><div class="top"><p class="src"><a name="v:product" class="def">product</a> :: <a href="Prelude.html#t:Num">Num</a> a => [a] -> a</p><div class="doc"><p>The <code><a href="Prelude.html#v:product">product</a></code> function computes the product of a finite list of numbers. </p></div></div><div class="top"><p class="src"><a name="v:concat" class="def">concat</a> :: [[a]] -> [a]</p><div class="doc"><p>Concatenate a list of lists. </p></div></div><div class="top"><p class="src"><a name="v:concatMap" class="def">concatMap</a> :: (a -> [b]) -> [a] -> [b]</p><div class="doc"><p>Map a function over a list and concatenate the results. </p></div></div><div class="top"><p class="src"><a name="v:maximum" class="def">maximum</a> :: <a href="Prelude.html#t:Ord">Ord</a> a => [a] -> a</p><div class="doc"><p><code><a href="Prelude.html#v:maximum">maximum</a></code> returns the maximum value from a list, which must be non-empty, finite, and of an ordered type. It is a special case of <code><a href="Data-List.html#v:maximumBy">maximumBy</a></code>, which allows the programmer to supply their own comparison function. </p></div></div><div class="top"><p class="src"><a name="v:minimum" class="def">minimum</a> :: <a href="Prelude.html#t:Ord">Ord</a> a => [a] -> a</p><div class="doc"><p><code><a href="Prelude.html#v:minimum">minimum</a></code> returns the minimum value from a list, which must be non-empty, finite, and of an ordered type. It is a special case of <code><a href="Data-List.html#v:minimumBy">minimumBy</a></code>, which allows the programmer to supply their own comparison function. </p></div></div><h2 id="g:14">Building lists </h2><h3 id="g:15">Scans </h3><div class="top"><p class="src"><a name="v:scanl" class="def">scanl</a> :: (a -> b -> a) -> a -> [b] -> [a]</p><div class="doc"><p><code><a href="Prelude.html#v:scanl">scanl</a></code> is similar to <code><a href="Prelude.html#v:foldl">foldl</a></code>, but returns a list of successive reduced values from the left: </p><pre> scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...] </pre><p>Note that </p><pre> last (scanl f z xs) == foldl f z xs. </pre></div></div><div class="top"><p class="src"><a name="v:scanl1" class="def">scanl1</a> :: (a -> a -> a) -> [a] -> [a]</p><div class="doc"><p><code><a href="Prelude.html#v:scanl1">scanl1</a></code> is a variant of <code><a href="Prelude.html#v:scanl">scanl</a></code> that has no starting value argument: </p><pre> scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...] </pre></div></div><div class="top"><p class="src"><a name="v:scanr" class="def">scanr</a> :: (a -> b -> b) -> b -> [a] -> [b]</p><div class="doc"><p><code><a href="Prelude.html#v:scanr">scanr</a></code> is the right-to-left dual of <code><a href="Prelude.html#v:scanl">scanl</a></code>. Note that </p><pre> head (scanr f z xs) == foldr f z xs. </pre></div></div><div class="top"><p class="src"><a name="v:scanr1" class="def">scanr1</a> :: (a -> a -> a) -> [a] -> [a]</p><div class="doc"><p><code><a href="Prelude.html#v:scanr1">scanr1</a></code> is a variant of <code><a href="Prelude.html#v:scanr">scanr</a></code> that has no starting value argument. </p></div></div><h3 id="g:16">Infinite lists </h3><div class="top"><p class="src"><a name="v:iterate" class="def">iterate</a> :: (a -> a) -> a -> [a]</p><div class="doc"><p><code><a href="Prelude.html#v:iterate">iterate</a></code> <code>f x</code> returns an infinite list of repeated applications of <code>f</code> to <code>x</code>: </p><pre> iterate f x == [x, f x, f (f x), ...] </pre></div></div><div class="top"><p class="src"><a name="v:repeat" class="def">repeat</a> :: a -> [a]</p><div class="doc"><p><code><a href="Prelude.html#v:repeat">repeat</a></code> <code>x</code> is an infinite list, with <code>x</code> the value of every element. </p></div></div><div class="top"><p class="src"><a name="v:replicate" class="def">replicate</a> :: <a href="Prelude.html#t:Int">Int</a> -> a -> [a]</p><div class="doc"><p><code><a href="Prelude.html#v:replicate">replicate</a></code> <code>n x</code> is a list of length <code>n</code> with <code>x</code> the value of every element. It is an instance of the more general <code>Data.List.genericReplicate</code>, in which <code>n</code> may be of any integral type. </p></div></div><div class="top"><p class="src"><a name="v:cycle" class="def">cycle</a> :: [a] -> [a]</p><div class="doc"><p><code><a href="Prelude.html#v:cycle">cycle</a></code> ties a finite list into a circular one, or equivalently, the infinite repetition of the original list. It is the identity on infinite lists. </p></div></div><h2 id="g:17">Sublists </h2><div class="top"><p class="src"><a name="v:take" class="def">take</a> :: <a href="Prelude.html#t:Int">Int</a> -> [a] -> [a]</p><div class="doc"><p><code><a href="Prelude.html#v:take">take</a></code> <code>n</code>, applied to a list <code>xs</code>, returns the prefix of <code>xs</code> of length <code>n</code>, or <code>xs</code> itself if <code>n > <code><a href="Prelude.html#v:length">length</a></code> xs</code>: </p><pre> take 5 "Hello World!" == "Hello" take 3 [1,2,3,4,5] == [1,2,3] take 3 [1,2] == [1,2] take 3 [] == [] take (-1) [1,2] == [] take 0 [1,2] == [] </pre><p>It is an instance of the more general <code>Data.List.genericTake</code>, in which <code>n</code> may be of any integral type. </p></div></div><div class="top"><p class="src"><a name="v:drop" class="def">drop</a> :: <a href="Prelude.html#t:Int">Int</a> -> [a] -> [a]</p><div class="doc"><p><code><a href="Prelude.html#v:drop">drop</a></code> <code>n xs</code> returns the suffix of <code>xs</code> after the first <code>n</code> elements, or <code>[]</code> if <code>n > <code><a href="Prelude.html#v:length">length</a></code> xs</code>: </p><pre> drop 6 "Hello World!" == "World!" drop 3 [1,2,3,4,5] == [4,5] drop 3 [1,2] == [] drop 3 [] == [] drop (-1) [1,2] == [1,2] drop 0 [1,2] == [1,2] </pre><p>It is an instance of the more general <code>Data.List.genericDrop</code>, in which <code>n</code> may be of any integral type. </p></div></div><div class="top"><p class="src"><a name="v:splitAt" class="def">splitAt</a> :: <a href="Prelude.html#t:Int">Int</a> -> [a] -> ([a], [a])</p><div class="doc"><p><code><a href="Prelude.html#v:splitAt">splitAt</a></code> <code>n xs</code> returns a tuple where first element is <code>xs</code> prefix of length <code>n</code> and second element is the remainder of the list: </p><pre> splitAt 6 "Hello World!" == ("Hello ","World!") splitAt 3 [1,2,3,4,5] == ([1,2,3],[4,5]) splitAt 1 [1,2,3] == ([1],[2,3]) splitAt 3 [1,2,3] == ([1,2,3],[]) splitAt 4 [1,2,3] == ([1,2,3],[]) splitAt 0 [1,2,3] == ([],[1,2,3]) splitAt (-1) [1,2,3] == ([],[1,2,3]) </pre><p>It is equivalent to <code>(<code><a href="Prelude.html#v:take">take</a></code> n xs, <code><a href="Prelude.html#v:drop">drop</a></code> n xs)</code>. <code><a href="Prelude.html#v:splitAt">splitAt</a></code> is an instance of the more general <code>Data.List.genericSplitAt</code>, in which <code>n</code> may be of any integral type. </p></div></div><div class="top"><p class="src"><a name="v:takeWhile" class="def">takeWhile</a> :: (a -> <a href="Prelude.html#t:Bool">Bool</a>) -> [a] -> [a]</p><div class="doc"><p><code><a href="Prelude.html#v:takeWhile">takeWhile</a></code>, applied to a predicate <code>p</code> and a list <code>xs</code>, returns the longest prefix (possibly empty) of <code>xs</code> of elements that satisfy <code>p</code>: </p><pre> takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2] takeWhile (< 9) [1,2,3] == [1,2,3] takeWhile (< 0) [1,2,3] == [] </pre></div></div><div class="top"><p class="src"><a name="v:dropWhile" class="def">dropWhile</a> :: (a -> <a href="Prelude.html#t:Bool">Bool</a>) -> [a] -> [a]</p><div class="doc"><p><code><a href="Prelude.html#v:dropWhile">dropWhile</a></code> <code>p xs</code> returns the suffix remaining after <code><a href="Prelude.html#v:takeWhile">takeWhile</a></code> <code>p xs</code>: </p><pre> dropWhile (< 3) [1,2,3,4,5,1,2,3] == [3,4,5,1,2,3] dropWhile (< 9) [1,2,3] == [] dropWhile (< 0) [1,2,3] == [1,2,3] </pre></div></div><div class="top"><p class="src"><a name="v:span" class="def">span</a> :: (a -> <a href="Prelude.html#t:Bool">Bool</a>) -> [a] -> ([a], [a])</p><div class="doc"><p><code><a href="Prelude.html#v:span">span</a></code>, applied to a predicate <code>p</code> and a list <code>xs</code>, returns a tuple where first element is longest prefix (possibly empty) of <code>xs</code> of elements that satisfy <code>p</code> and second element is the remainder of the list: </p><pre> span (< 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4]) span (< 9) [1,2,3] == ([1,2,3],[]) span (< 0) [1,2,3] == ([],[1,2,3]) </pre><p><code><a href="Prelude.html#v:span">span</a></code> <code>p xs</code> is equivalent to <code>(<code><a href="Prelude.html#v:takeWhile">takeWhile</a></code> p xs, <code><a href="Prelude.html#v:dropWhile">dropWhile</a></code> p xs)</code> </p></div></div><div class="top"><p class="src"><a name="v:break" class="def">break</a> :: (a -> <a href="Prelude.html#t:Bool">Bool</a>) -> [a] -> ([a], [a])</p><div class="doc"><p><code><a href="Prelude.html#v:break">break</a></code>, applied to a predicate <code>p</code> and a list <code>xs</code>, returns a tuple where first element is longest prefix (possibly empty) of <code>xs</code> of elements that <em>do not satisfy</em> <code>p</code> and second element is the remainder of the list: </p><pre> break (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4]) break (< 9) [1,2,3] == ([],[1,2,3]) break (> 9) [1,2,3] == ([1,2,3],[]) </pre><p><code><a href="Prelude.html#v:break">break</a></code> <code>p</code> is equivalent to <code><code><a href="Prelude.html#v:span">span</a></code> (<code><a href="Prelude.html#v:not">not</a></code> . p)</code>. </p></div></div><h2 id="g:18">Searching lists </h2><div class="top"><p class="src"><a name="v:elem" class="def">elem</a> :: <a href="Prelude.html#t:Eq">Eq</a> a => a -> [a] -> <a href="Prelude.html#t:Bool">Bool</a></p><div class="doc"><p><code><a href="Prelude.html#v:elem">elem</a></code> is the list membership predicate, usually written in infix form, e.g., <code>x `elem` xs</code>. For the result to be <code><a href="Prelude.html#v:False">False</a></code>, the list must be finite; <code><a href="Prelude.html#v:True">True</a></code>, however, results from an element equal to <code>x</code> found at a finite index of a finite or infinite list. </p></div></div><div class="top"><p class="src"><a name="v:notElem" class="def">notElem</a> :: <a href="Prelude.html#t:Eq">Eq</a> a => a -> [a] -> <a href="Prelude.html#t:Bool">Bool</a></p><div class="doc"><p><code><a href="Prelude.html#v:notElem">notElem</a></code> is the negation of <code><a href="Prelude.html#v:elem">elem</a></code>. </p></div></div><div class="top"><p class="src"><a name="v:lookup" class="def">lookup</a> :: <a href="Prelude.html#t:Eq">Eq</a> a => a -> [(a, b)] -> <a href="Prelude.html#t:Maybe">Maybe</a> b</p><div class="doc"><p><code><a href="Prelude.html#v:lookup">lookup</a></code> <code>key assocs</code> looks up a key in an association list. </p></div></div><h2 id="g:19">Zipping and unzipping lists </h2><div class="top"><p class="src"><a name="v:zip" class="def">zip</a> :: [a] -> [b] -> [(a, b)]</p><div class="doc"><p><code><a href="Prelude.html#v:zip">zip</a></code> takes two lists and returns a list of corresponding pairs. If one input list is short, excess elements of the longer list are discarded. </p></div></div><div class="top"><p class="src"><a name="v:zip3" class="def">zip3</a> :: [a] -> [b] -> [c] -> [(a, b, c)]</p><div class="doc"><p><code><a href="Prelude.html#v:zip3">zip3</a></code> takes three lists and returns a list of triples, analogous to <code><a href="Prelude.html#v:zip">zip</a></code>. </p></div></div><div class="top"><p class="src"><a name="v:zipWith" class="def">zipWith</a> :: (a -> b -> c) -> [a] -> [b] -> [c]</p><div class="doc"><p><code><a href="Prelude.html#v:zipWith">zipWith</a></code> generalises <code><a href="Prelude.html#v:zip">zip</a></code> by zipping with the function given as the first argument, instead of a tupling function. For example, <code><code><a href="Prelude.html#v:zipWith">zipWith</a></code> (+)</code> is applied to two lists to produce the list of corresponding sums. </p></div></div><div class="top"><p class="src"><a name="v:zipWith3" class="def">zipWith3</a> :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]</p><div class="doc"><p>The <code><a href="Prelude.html#v:zipWith3">zipWith3</a></code> function takes a function which combines three elements, as well as three lists and returns a list of their point-wise combination, analogous to <code><a href="Prelude.html#v:zipWith">zipWith</a></code>. </p></div></div><div class="top"><p class="src"><a name="v:unzip" class="def">unzip</a> :: [(a, b)] -> ([a], [b])</p><div class="doc"><p><code><a href="Prelude.html#v:unzip">unzip</a></code> transforms a list of pairs into a list of first components and a list of second components. </p></div></div><div class="top"><p class="src"><a name="v:unzip3" class="def">unzip3</a> :: [(a, b, c)] -> ([a], [b], [c])</p><div class="doc"><p>The <code><a href="Prelude.html#v:unzip3">unzip3</a></code> function takes a list of triples and returns three lists, analogous to <code><a href="Prelude.html#v:unzip">unzip</a></code>. </p></div></div><h2 id="g:20">Functions on strings </h2><div class="top"><p class="src"><a name="v:lines" class="def">lines</a> :: <a href="Prelude.html#t:String">String</a> -> [<a href="Prelude.html#t:String">String</a>]</p><div class="doc"><p><code><a href="Prelude.html#v:lines">lines</a></code> breaks a string up into a list of strings at newline characters. The resulting strings do not contain newlines. </p></div></div><div class="top"><p class="src"><a name="v:words" class="def">words</a> :: <a href="Prelude.html#t:String">String</a> -> [<a href="Prelude.html#t:String">String</a>]</p><div class="doc"><p><code><a href="Prelude.html#v:words">words</a></code> breaks a string up into a list of words, which were delimited by white space. </p></div></div><div class="top"><p class="src"><a name="v:unlines" class="def">unlines</a> :: [<a href="Prelude.html#t:String">String</a>] -> <a href="Prelude.html#t:String">String</a></p><div class="doc"><p><code><a href="Prelude.html#v:unlines">unlines</a></code> is an inverse operation to <code><a href="Prelude.html#v:lines">lines</a></code>. It joins lines, after appending a terminating newline to each. </p></div></div><div class="top"><p class="src"><a name="v:unwords" class="def">unwords</a> :: [<a href="Prelude.html#t:String">String</a>] -> <a href="Prelude.html#t:String">String</a></p><div class="doc"><p><code><a href="Prelude.html#v:unwords">unwords</a></code> is an inverse operation to <code><a href="Prelude.html#v:words">words</a></code>. It joins words with separating spaces. </p></div></div><h1 id="g:21">Converting to and from <code>String</code> </h1><h2 id="g:22">Converting to <code>String</code> </h2><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:ShowS" class="def">ShowS</a> = <a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:String">String</a></p><div class="doc"><p>The <code>shows</code> functions return a function that prepends the output <code><a href="Prelude.html#t:String">String</a></code> to an existing <code><a href="Prelude.html#t:String">String</a></code>. This allows constant-time concatenation of results using function composition. </p></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a name="t:Show" class="def">Show</a> a <span class="keyword">where</span></p><div class="doc"><p>Conversion of values to readable <code><a href="Prelude.html#t:String">String</a></code>s. </p><p>Minimal complete definition: <code><a href="Prelude.html#v:showsPrec">showsPrec</a></code> or <code><a href="Prelude.html#v:show">show</a></code>. </p><p>Derived instances of <code><a href="Prelude.html#t:Show">Show</a></code> have the following properties, which are compatible with derived instances of <code>Text.Read.Read</code>: </p><ul><li> The result of <code><a href="Prelude.html#v:show">show</a></code> is a syntactically correct Haskell expression containing only constants, given the fixity declarations in force at the point where the type is declared. It contains only the constructor names defined in the data type, parentheses, and spaces. When labelled constructor fields are used, braces, commas, field names, and equal signs are also used. </li><li> If the constructor is defined to be an infix operator, then <code><a href="Prelude.html#v:showsPrec">showsPrec</a></code> will produce infix applications of the constructor. </li><li> the representation will be enclosed in parentheses if the precedence of the top-level constructor in <code>x</code> is less than <code>d</code> (associativity is ignored). Thus, if <code>d</code> is <code>0</code> then the result is never surrounded in parentheses; if <code>d</code> is <code>11</code> it is always surrounded in parentheses, unless it is an atomic expression. </li><li> If the constructor is defined using record syntax, then <code><a href="Prelude.html#v:show">show</a></code> will produce the record-syntax form, with the fields given in the same order as the original declaration. </li></ul><p>For example, given the declarations </p><pre> infixr 5 :^: data Tree a = Leaf a | Tree a :^: Tree a </pre><p>the derived instance of <code><a href="Prelude.html#t:Show">Show</a></code> is equivalent to </p><pre> instance (Show a) => Show (Tree a) where showsPrec d (Leaf m) = showParen (d > app_prec) $ showString "Leaf " . showsPrec (app_prec+1) m where app_prec = 10 showsPrec d (u :^: v) = showParen (d > up_prec) $ showsPrec (up_prec+1) u . showString " :^: " . showsPrec (up_prec+1) v where up_prec = 5 </pre><p>Note that right-associativity of <code>:^:</code> is ignored. For example, </p><ul><li> <code><code><a href="Prelude.html#v:show">show</a></code> (Leaf 1 :^: Leaf 2 :^: Leaf 3)</code> produces the string <code>"Leaf 1 :^: (Leaf 2 :^: Leaf 3)"</code>. </li></ul></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:showsPrec" class="def">showsPrec</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Prelude.html#t:Int">Int</a></td><td class="doc"><p>the operator precedence of the enclosing context (a number from <code>0</code> to <code>11</code>). Function application has precedence <code>10</code>. </p></td></tr><tr><td class="src">-> a</td><td class="doc"><p>the value to be converted to a <code><a href="Prelude.html#t:String">String</a></code> </p></td></tr><tr><td class="src">-> <a href="Prelude.html#t:ShowS">ShowS</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Convert a value to a readable <code><a href="Prelude.html#t:String">String</a></code>. </p><p><code><a href="Prelude.html#v:showsPrec">showsPrec</a></code> should satisfy the law </p><pre> showsPrec d x r ++ s == showsPrec d x (r ++ s) </pre><p>Derived instances of <code>Text.Read.Read</code> and <code><a href="Prelude.html#t:Show">Show</a></code> satisfy the following: </p><ul><li> <code>(x,"")</code> is an element of <code>(<code>Text.Read.readsPrec</code> d (<code><a href="Prelude.html#v:showsPrec">showsPrec</a></code> d x ""))</code>. </li></ul><p>That is, <code>Text.Read.readsPrec</code> parses the string produced by <code><a href="Prelude.html#v:showsPrec">showsPrec</a></code>, and delivers the value that <code><a href="Prelude.html#v:showsPrec">showsPrec</a></code> started with. </p></div><p class="src"><a name="v:show" class="def">show</a> :: a -> <a href="Prelude.html#t:String">String</a></p><div class="doc"><p>A specialised variant of <code><a href="Prelude.html#v:showsPrec">showsPrec</a></code>, using precedence context zero, and returning an ordinary <code><a href="Prelude.html#t:String">String</a></code>. </p></div><p class="src"><a name="v:showList" class="def">showList</a> :: [a] -> <a href="Prelude.html#t:ShowS">ShowS</a></p><div class="doc"><p>The method <code><a href="Prelude.html#v:showList">showList</a></code> is provided to allow the programmer to give a specialised way of showing lists of values. For example, this is used by the predefined <code><a href="Prelude.html#t:Show">Show</a></code> instance of the <code><a href="Prelude.html#t:Char">Char</a></code> type, where values of type <code><a href="Prelude.html#t:String">String</a></code> should be shown in double quotes, rather than between square brackets. </p></div></div><div class="subs instances"><p id="control.i:Show" class="caption collapser" onclick="toggleSection('i:Show')">Instances</p><div id="section.i:Show" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Prelude.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Int.html#t:Int8">Int8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Int.html#t:Int16">Int16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Int.html#t:Int32">Int32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Int.html#t:Int64">Int64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Prelude.html#t:Ordering">Ordering</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Word.html#t:Word">Word</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Word.html#t:Word8">Word8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Word.html#t:Word16">Word16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Word.html#t:Word32">Word32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Word.html#t:Word64">Word64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> ()</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Typeable.html#t:TyCon">TyCon</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Typeable.html#t:TypeRep">TypeRep</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:ArithException">ArithException</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:ErrorCall">ErrorCall</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:SomeException">SomeException</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:IOException">IOException</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:MaskingState">MaskingState</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Text-Read-Lex.html#t:Lexeme">Lexeme</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-IO.html#t:IOMode">IOMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="GHC-IO-Device.html#t:SeekMode">SeekMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CUIntMax">CUIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CIntMax">CIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CUIntPtr">CUIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CIntPtr">CIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CTime">CTime</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CClock">CClock</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CSigAtomic">CSigAtomic</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CWchar">CWchar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CSize">CSize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CPtrdiff">CPtrdiff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CDouble">CDouble</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CFloat">CFloat</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CULLong">CULLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CLLong">CLLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CULong">CULong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CLong">CLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CUInt">CUInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CInt">CInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CUShort">CUShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CShort">CShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CUChar">CUChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CSChar">CSChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-C-Types.html#t:CChar">CChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Monoid.html#t:Any">Any</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Monoid.html#t:All">All</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Char.html#t:GeneralCategory">GeneralCategory</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> HashData</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Dynamic.html#t:Dynamic">Dynamic</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-Ptr.html#t:IntPtr">IntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Foreign-Ptr.html#t:WordPtr">WordPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="GHC-IO-Handle.html#t:NewlineMode">NewlineMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="GHC-IO-Handle.html#t:Newline">Newline</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="GHC-IO-Handle.html#t:BufferMode">BufferMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> HandleType</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="GHC-IO-Handle.html#t:Handle">Handle</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-IO-Error.html#t:IOErrorType">IOErrorType</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Exit.html#t:ExitCode">ExitCode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:ArrayException">ArrayException</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:AsyncException">AsyncException</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:AssertionFailed">AssertionFailed</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:Deadlock">Deadlock</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:BlockedIndefinitelyOnSTM">BlockedIndefinitelyOnSTM</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:BlockedIndefinitelyOnMVar">BlockedIndefinitelyOnMVar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> BlockedIndefinitely</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> BlockedOnDeadMVar</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="GHC-Conc.html#t:ThreadStatus">ThreadStatus</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="GHC-Conc.html#t:BlockReason">BlockReason</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Concurrent.html#t:ThreadId">ThreadId</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:NestedAtomically">NestedAtomically</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:NonTermination">NonTermination</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:NoMethodError">NoMethodError</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:RecUpdError">RecUpdError</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:RecConError">RecConError</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:RecSelError">RecSelError</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-Exception-Base.html#t:PatternMatchFail">PatternMatchFail</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Posix-Types.html#t:Fd">Fd</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Posix-Types.html#t:CRLim">CRLim</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Posix-Types.html#t:CTcflag">CTcflag</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Posix-Types.html#t:CSpeed">CSpeed</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Posix-Types.html#t:CCc">CCc</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Posix-Types.html#t:CUid">CUid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Posix-Types.html#t:CNlink">CNlink</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Posix-Types.html#t:CGid">CGid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Posix-Types.html#t:CSsize">CSsize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Posix-Types.html#t:CPid">CPid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Posix-Types.html#t:COff">COff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Posix-Types.html#t:CMode">CMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Posix-Types.html#t:CIno">CIno</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Posix-Types.html#t:CDev">CDev</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> Control</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> ControlMessage</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> Timeout</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Event.html#t:Event">Event</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> EventType</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> Event</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> EPollFd</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> Unique</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> State</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Event.html#t:IOCallback">IOCallback</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Event.html#t:FdKey">FdKey</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> FdData</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> FD</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="GHC-IO-Handle.html#t:HandlePosn">HandlePosn</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Data.html#t:Fixity">Fixity</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Data.html#t:ConstrRep">ConstrRep</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Data.html#t:DataRep">DataRep</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Data.html#t:Constr">Constr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Data.html#t:DataType">DataType</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> Timeout</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Data-Version.html#t:Version">Version</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="Control-OldException.html#t:Exception">Exception</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> Event</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> PollFd</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> a => <a href="Prelude.html#t:Show">Show</a> [a]</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Integral">Integral</a> a => <a href="Prelude.html#t:Show">Show</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> (<a href="Foreign-Ptr.html#t:Ptr">Ptr</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> (<a href="Foreign-Ptr.html#t:FunPtr">FunPtr</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> a => <a href="Prelude.html#t:Show">Show</a> ([::] a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> a => <a href="Prelude.html#t:Show">Show</a> (<a href="Prelude.html#t:Maybe">Maybe</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> a => <a href="Prelude.html#t:Show">Show</a> (<a href="Data-Monoid.html#t:Last">Last</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> a => <a href="Prelude.html#t:Show">Show</a> (<a href="Data-Monoid.html#t:First">First</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> a => <a href="Prelude.html#t:Show">Show</a> (<a href="Data-Monoid.html#t:Product">Product</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> a => <a href="Prelude.html#t:Show">Show</a> (<a href="Data-Monoid.html#t:Sum">Sum</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> a => <a href="Prelude.html#t:Show">Show</a> (<a href="Data-Monoid.html#t:Dual">Dual</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> (<a href="Foreign-ForeignPtr.html#t:ForeignPtr">ForeignPtr</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> a => <a href="Prelude.html#t:Show">Show</a> (IntMap a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> a => <a href="Prelude.html#t:Show">Show</a> (Sequ a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> a => <a href="Prelude.html#t:Show">Show</a> (LTree a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> a => <a href="Prelude.html#t:Show">Show</a> (PSQ a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> a => <a href="Prelude.html#t:Show">Show</a> (Elem a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:RealFloat">RealFloat</a> a => <a href="Prelude.html#t:Show">Show</a> (<a href="Data-Complex.html#t:Complex">Complex</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Fixed.html#t:HasResolution">HasResolution</a> a => <a href="Prelude.html#t:Show">Show</a> (<a href="Data-Fixed.html#t:Fixed">Fixed</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> (a -> b)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b) => <a href="Prelude.html#t:Show">Show</a> (<a href="Prelude.html#t:Either">Either</a> a b)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b) => <a href="Prelude.html#t:Show">Show</a> (a, b)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> (<a href="Control-Monad-ST.html#t:ST">ST</a> s a)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Data-Ix.html#t:Ix">Ix</a> a, <a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b) => <a href="Prelude.html#t:Show">Show</a> (Array a b)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b, <a href="Prelude.html#t:Show">Show</a> c) => <a href="Prelude.html#t:Show">Show</a> (a, b, c)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b, <a href="Prelude.html#t:Show">Show</a> c, <a href="Prelude.html#t:Show">Show</a> d) => <a href="Prelude.html#t:Show">Show</a> (a, b, c, d)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b, <a href="Prelude.html#t:Show">Show</a> c, <a href="Prelude.html#t:Show">Show</a> d, <a href="Prelude.html#t:Show">Show</a> e) => <a href="Prelude.html#t:Show">Show</a> (a, b, c, d, e)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b, <a href="Prelude.html#t:Show">Show</a> c, <a href="Prelude.html#t:Show">Show</a> d, <a href="Prelude.html#t:Show">Show</a> e, <a href="Prelude.html#t:Show">Show</a> f) => <a href="Prelude.html#t:Show">Show</a> (a, b, c, d, e, f)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b, <a href="Prelude.html#t:Show">Show</a> c, <a href="Prelude.html#t:Show">Show</a> d, <a href="Prelude.html#t:Show">Show</a> e, <a href="Prelude.html#t:Show">Show</a> f, <a href="Prelude.html#t:Show">Show</a> g) => <a href="Prelude.html#t:Show">Show</a> (a, b, c, d, e, f, g)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b, <a href="Prelude.html#t:Show">Show</a> c, <a href="Prelude.html#t:Show">Show</a> d, <a href="Prelude.html#t:Show">Show</a> e, <a href="Prelude.html#t:Show">Show</a> f, <a href="Prelude.html#t:Show">Show</a> g, <a href="Prelude.html#t:Show">Show</a> h) => <a href="Prelude.html#t:Show">Show</a> (a, b, c, d, e, f, g, h)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b, <a href="Prelude.html#t:Show">Show</a> c, <a href="Prelude.html#t:Show">Show</a> d, <a href="Prelude.html#t:Show">Show</a> e, <a href="Prelude.html#t:Show">Show</a> f, <a href="Prelude.html#t:Show">Show</a> g, <a href="Prelude.html#t:Show">Show</a> h, <a href="Prelude.html#t:Show">Show</a> i) => <a href="Prelude.html#t:Show">Show</a> (a, b, c, d, e, f, g, h, i)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b, <a href="Prelude.html#t:Show">Show</a> c, <a href="Prelude.html#t:Show">Show</a> d, <a href="Prelude.html#t:Show">Show</a> e, <a href="Prelude.html#t:Show">Show</a> f, <a href="Prelude.html#t:Show">Show</a> g, <a href="Prelude.html#t:Show">Show</a> h, <a href="Prelude.html#t:Show">Show</a> i, <a href="Prelude.html#t:Show">Show</a> j) => <a href="Prelude.html#t:Show">Show</a> (a, b, c, d, e, f, g, h, i, j)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b, <a href="Prelude.html#t:Show">Show</a> c, <a href="Prelude.html#t:Show">Show</a> d, <a href="Prelude.html#t:Show">Show</a> e, <a href="Prelude.html#t:Show">Show</a> f, <a href="Prelude.html#t:Show">Show</a> g, <a href="Prelude.html#t:Show">Show</a> h, <a href="Prelude.html#t:Show">Show</a> i, <a href="Prelude.html#t:Show">Show</a> j, <a href="Prelude.html#t:Show">Show</a> k) => <a href="Prelude.html#t:Show">Show</a> (a, b, c, d, e, f, g, h, i, j, k)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b, <a href="Prelude.html#t:Show">Show</a> c, <a href="Prelude.html#t:Show">Show</a> d, <a href="Prelude.html#t:Show">Show</a> e, <a href="Prelude.html#t:Show">Show</a> f, <a href="Prelude.html#t:Show">Show</a> g, <a href="Prelude.html#t:Show">Show</a> h, <a href="Prelude.html#t:Show">Show</a> i, <a href="Prelude.html#t:Show">Show</a> j, <a href="Prelude.html#t:Show">Show</a> k, <a href="Prelude.html#t:Show">Show</a> l) => <a href="Prelude.html#t:Show">Show</a> (a, b, c, d, e, f, g, h, i, j, k, l)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b, <a href="Prelude.html#t:Show">Show</a> c, <a href="Prelude.html#t:Show">Show</a> d, <a href="Prelude.html#t:Show">Show</a> e, <a href="Prelude.html#t:Show">Show</a> f, <a href="Prelude.html#t:Show">Show</a> g, <a href="Prelude.html#t:Show">Show</a> h, <a href="Prelude.html#t:Show">Show</a> i, <a href="Prelude.html#t:Show">Show</a> j, <a href="Prelude.html#t:Show">Show</a> k, <a href="Prelude.html#t:Show">Show</a> l, <a href="Prelude.html#t:Show">Show</a> m) => <a href="Prelude.html#t:Show">Show</a> (a, b, c, d, e, f, g, h, i, j, k, l, m)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b, <a href="Prelude.html#t:Show">Show</a> c, <a href="Prelude.html#t:Show">Show</a> d, <a href="Prelude.html#t:Show">Show</a> e, <a href="Prelude.html#t:Show">Show</a> f, <a href="Prelude.html#t:Show">Show</a> g, <a href="Prelude.html#t:Show">Show</a> h, <a href="Prelude.html#t:Show">Show</a> i, <a href="Prelude.html#t:Show">Show</a> j, <a href="Prelude.html#t:Show">Show</a> k, <a href="Prelude.html#t:Show">Show</a> l, <a href="Prelude.html#t:Show">Show</a> m, <a href="Prelude.html#t:Show">Show</a> n) => <a href="Prelude.html#t:Show">Show</a> (a, b, c, d, e, f, g, h, i, j, k, l, m, n)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Show">Show</a> a, <a href="Prelude.html#t:Show">Show</a> b, <a href="Prelude.html#t:Show">Show</a> c, <a href="Prelude.html#t:Show">Show</a> d, <a href="Prelude.html#t:Show">Show</a> e, <a href="Prelude.html#t:Show">Show</a> f, <a href="Prelude.html#t:Show">Show</a> g, <a href="Prelude.html#t:Show">Show</a> h, <a href="Prelude.html#t:Show">Show</a> i, <a href="Prelude.html#t:Show">Show</a> j, <a href="Prelude.html#t:Show">Show</a> k, <a href="Prelude.html#t:Show">Show</a> l, <a href="Prelude.html#t:Show">Show</a> m, <a href="Prelude.html#t:Show">Show</a> n, <a href="Prelude.html#t:Show">Show</a> o) => <a href="Prelude.html#t:Show">Show</a> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:shows" class="def">shows</a> :: <a href="Prelude.html#t:Show">Show</a> a => a -> <a href="Prelude.html#t:ShowS">ShowS</a></p><div class="doc"><p>equivalent to <code><a href="Prelude.html#v:showsPrec">showsPrec</a></code> with a precedence of 0. </p></div></div><div class="top"><p class="src"><a name="v:showChar" class="def">showChar</a> :: <a href="Prelude.html#t:Char">Char</a> -> <a href="Prelude.html#t:ShowS">ShowS</a></p><div class="doc"><p>utility function converting a <code><a href="Prelude.html#t:Char">Char</a></code> to a show function that simply prepends the character unchanged. </p></div></div><div class="top"><p class="src"><a name="v:showString" class="def">showString</a> :: <a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:ShowS">ShowS</a></p><div class="doc"><p>utility function converting a <code><a href="Prelude.html#t:String">String</a></code> to a show function that simply prepends the string unchanged. </p></div></div><div class="top"><p class="src"><a name="v:showParen" class="def">showParen</a> :: <a href="Prelude.html#t:Bool">Bool</a> -> <a href="Prelude.html#t:ShowS">ShowS</a> -> <a href="Prelude.html#t:ShowS">ShowS</a></p><div class="doc"><p>utility function that surrounds the inner show function with parentheses when the <code><a href="Prelude.html#t:Bool">Bool</a></code> parameter is <code><a href="Prelude.html#v:True">True</a></code>. </p></div></div><h2 id="g:23">Converting from <code>String</code> </h2><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:ReadS" class="def">ReadS</a> a = <a href="Prelude.html#t:String">String</a> -> [(a, <a href="Prelude.html#t:String">String</a>)]</p><div class="doc"><p>A parser for a type <code>a</code>, represented as a function that takes a <code><a href="Prelude.html#t:String">String</a></code> and returns a list of possible parses as <code>(a,<code><a href="Prelude.html#t:String">String</a></code>)</code> pairs. </p><p>Note that this kind of backtracking parser is very inefficient; reading a large structure may be quite slow (cf <code><a href="Text-ParserCombinators-ReadP.html#t:ReadP">ReadP</a></code>). </p></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a name="t:Read" class="def">Read</a> a <span class="keyword">where</span></p><div class="doc"><p>Parsing of <code><a href="Prelude.html#t:String">String</a></code>s, producing values. </p><p>Minimal complete definition: <code><a href="Prelude.html#v:readsPrec">readsPrec</a></code> (or, for GHC only, <code><a href="Text-Read.html#v:readPrec">readPrec</a></code>) </p><p>Derived instances of <code><a href="Prelude.html#t:Read">Read</a></code> make the following assumptions, which derived instances of <code>Text.Show.Show</code> obey: </p><ul><li> If the constructor is defined to be an infix operator, then the derived <code><a href="Prelude.html#t:Read">Read</a></code> instance will parse only infix applications of the constructor (not the prefix form). </li><li> Associativity is not used to reduce the occurrence of parentheses, although precedence may be. </li><li> If the constructor is defined using record syntax, the derived <code><a href="Prelude.html#t:Read">Read</a></code> will parse only the record-syntax form, and furthermore, the fields must be given in the same order as the original declaration. </li><li> The derived <code><a href="Prelude.html#t:Read">Read</a></code> instance allows arbitrary Haskell whitespace between tokens of the input string. Extra parentheses are also allowed. </li></ul><p>For example, given the declarations </p><pre> infixr 5 :^: data Tree a = Leaf a | Tree a :^: Tree a </pre><p>the derived instance of <code><a href="Prelude.html#t:Read">Read</a></code> in Haskell 98 is equivalent to </p><pre> instance (Read a) => Read (Tree a) where readsPrec d r = readParen (d > app_prec) (\r -> [(Leaf m,t) | ("Leaf",s) <- lex r, (m,t) <- readsPrec (app_prec+1) s]) r ++ readParen (d > up_prec) (\r -> [(u:^:v,w) | (u,s) <- readsPrec (up_prec+1) r, (":^:",t) <- lex s, (v,w) <- readsPrec (up_prec+1) t]) r where app_prec = 10 up_prec = 5 </pre><p>Note that right-associativity of <code>:^:</code> is unused. </p><p>The derived instance in GHC is equivalent to </p><pre> instance (Read a) => Read (Tree a) where readPrec = parens $ (prec app_prec $ do Ident "Leaf" <- lexP m <- step readPrec return (Leaf m)) +++ (prec up_prec $ do u <- step readPrec Symbol ":^:" <- lexP v <- step readPrec return (u :^: v)) where app_prec = 10 up_prec = 5 readListPrec = readListPrecDefault </pre></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:readsPrec" class="def">readsPrec</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Prelude.html#t:Int">Int</a></td><td class="doc"><p>the operator precedence of the enclosing context (a number from <code>0</code> to <code>11</code>). Function application has precedence <code>10</code>. </p></td></tr><tr><td class="src">-> <a href="Prelude.html#t:ReadS">ReadS</a> a</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>attempts to parse a value from the front of the string, returning a list of (parsed value, remaining string) pairs. If there is no successful parse, the returned list is empty. </p><p>Derived instances of <code><a href="Prelude.html#t:Read">Read</a></code> and <code>Text.Show.Show</code> satisfy the following: </p><ul><li> <code>(x,"")</code> is an element of <code>(<code><a href="Prelude.html#v:readsPrec">readsPrec</a></code> d (<code>Text.Show.showsPrec</code> d x ""))</code>. </li></ul><p>That is, <code><a href="Prelude.html#v:readsPrec">readsPrec</a></code> parses the string produced by <code>Text.Show.showsPrec</code>, and delivers the value that <code>Text.Show.showsPrec</code> started with. </p></div><p class="src"><a name="v:readList" class="def">readList</a> :: <a href="Prelude.html#t:ReadS">ReadS</a> [a]</p><div class="doc"><p>The method <code><a href="Prelude.html#v:readList">readList</a></code> is provided to allow the programmer to give a specialised way of parsing lists of values. For example, this is used by the predefined <code><a href="Prelude.html#t:Read">Read</a></code> instance of the <code><a href="Prelude.html#t:Char">Char</a></code> type, where values of type <code><a href="Prelude.html#t:String">String</a></code> should be are expected to use double quotes, rather than square brackets. </p></div></div><div class="subs instances"><p id="control.i:Read" class="caption collapser" onclick="toggleSection('i:Read')">Instances</p><div id="section.i:Read" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Prelude.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Prelude.html#t:Char">Char</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Prelude.html#t:Int">Int</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Data-Int.html#t:Int8">Int8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Data-Int.html#t:Int16">Int16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Data-Int.html#t:Int32">Int32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Data-Int.html#t:Int64">Int64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Prelude.html#t:Integer">Integer</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Prelude.html#t:Ordering">Ordering</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Data-Word.html#t:Word">Word</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Data-Word.html#t:Word8">Word8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Data-Word.html#t:Word16">Word16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Data-Word.html#t:Word32">Word32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Data-Word.html#t:Word64">Word64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> ()</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Text-Read-Lex.html#t:Lexeme">Lexeme</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System-IO.html#t:IOMode">IOMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="GHC-IO-Device.html#t:SeekMode">SeekMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CUIntMax">CUIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CIntMax">CIntMax</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CUIntPtr">CUIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CIntPtr">CIntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CTime">CTime</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CClock">CClock</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CSigAtomic">CSigAtomic</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CWchar">CWchar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CSize">CSize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CPtrdiff">CPtrdiff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CDouble">CDouble</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CFloat">CFloat</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CULLong">CULLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CLLong">CLLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CULong">CULong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CLong">CLong</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CUInt">CUInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CInt">CInt</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CUShort">CUShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CShort">CShort</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CUChar">CUChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CSChar">CSChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-C-Types.html#t:CChar">CChar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Data-Monoid.html#t:Any">Any</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Data-Monoid.html#t:All">All</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Data-Char.html#t:GeneralCategory">GeneralCategory</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-Ptr.html#t:IntPtr">IntPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Foreign-Ptr.html#t:WordPtr">WordPtr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="GHC-IO-Handle.html#t:NewlineMode">NewlineMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="GHC-IO-Handle.html#t:Newline">Newline</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="GHC-IO-Handle.html#t:BufferMode">BufferMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System-Exit.html#t:ExitCode">ExitCode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System-Posix-Types.html#t:Fd">Fd</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System-Posix-Types.html#t:CRLim">CRLim</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System-Posix-Types.html#t:CTcflag">CTcflag</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System-Posix-Types.html#t:CSpeed">CSpeed</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System-Posix-Types.html#t:CCc">CCc</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System-Posix-Types.html#t:CUid">CUid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System-Posix-Types.html#t:CNlink">CNlink</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System-Posix-Types.html#t:CGid">CGid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System-Posix-Types.html#t:CSsize">CSsize</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System-Posix-Types.html#t:CPid">CPid</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System-Posix-Types.html#t:COff">COff</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System-Posix-Types.html#t:CMode">CMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System-Posix-Types.html#t:CIno">CIno</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System-Posix-Types.html#t:CDev">CDev</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="Data-Version.html#t:Version">Version</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:Read">Read</a> [a]</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Integral">Integral</a> a, <a href="Prelude.html#t:Read">Read</a> a) => <a href="Prelude.html#t:Read">Read</a> (<a href="Data-Ratio.html#t:Ratio">Ratio</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:Read">Read</a> ([::] a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:Read">Read</a> (<a href="Prelude.html#t:Maybe">Maybe</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:Read">Read</a> (<a href="Data-Monoid.html#t:Last">Last</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:Read">Read</a> (<a href="Data-Monoid.html#t:First">First</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:Read">Read</a> (<a href="Data-Monoid.html#t:Product">Product</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:Read">Read</a> (<a href="Data-Monoid.html#t:Sum">Sum</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:Read">Read</a> (<a href="Data-Monoid.html#t:Dual">Dual</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:RealFloat">RealFloat</a> a) => <a href="Prelude.html#t:Read">Read</a> (<a href="Data-Complex.html#t:Complex">Complex</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b) => <a href="Prelude.html#t:Read">Read</a> (<a href="Prelude.html#t:Either">Either</a> a b)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b) => <a href="Prelude.html#t:Read">Read</a> (a, b)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Data-Ix.html#t:Ix">Ix</a> a, <a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b) => <a href="Prelude.html#t:Read">Read</a> (Array a b)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b, <a href="Prelude.html#t:Read">Read</a> c) => <a href="Prelude.html#t:Read">Read</a> (a, b, c)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b, <a href="Prelude.html#t:Read">Read</a> c, <a href="Prelude.html#t:Read">Read</a> d) => <a href="Prelude.html#t:Read">Read</a> (a, b, c, d)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b, <a href="Prelude.html#t:Read">Read</a> c, <a href="Prelude.html#t:Read">Read</a> d, <a href="Prelude.html#t:Read">Read</a> e) => <a href="Prelude.html#t:Read">Read</a> (a, b, c, d, e)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b, <a href="Prelude.html#t:Read">Read</a> c, <a href="Prelude.html#t:Read">Read</a> d, <a href="Prelude.html#t:Read">Read</a> e, <a href="Prelude.html#t:Read">Read</a> f) => <a href="Prelude.html#t:Read">Read</a> (a, b, c, d, e, f)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b, <a href="Prelude.html#t:Read">Read</a> c, <a href="Prelude.html#t:Read">Read</a> d, <a href="Prelude.html#t:Read">Read</a> e, <a href="Prelude.html#t:Read">Read</a> f, <a href="Prelude.html#t:Read">Read</a> g) => <a href="Prelude.html#t:Read">Read</a> (a, b, c, d, e, f, g)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b, <a href="Prelude.html#t:Read">Read</a> c, <a href="Prelude.html#t:Read">Read</a> d, <a href="Prelude.html#t:Read">Read</a> e, <a href="Prelude.html#t:Read">Read</a> f, <a href="Prelude.html#t:Read">Read</a> g, <a href="Prelude.html#t:Read">Read</a> h) => <a href="Prelude.html#t:Read">Read</a> (a, b, c, d, e, f, g, h)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b, <a href="Prelude.html#t:Read">Read</a> c, <a href="Prelude.html#t:Read">Read</a> d, <a href="Prelude.html#t:Read">Read</a> e, <a href="Prelude.html#t:Read">Read</a> f, <a href="Prelude.html#t:Read">Read</a> g, <a href="Prelude.html#t:Read">Read</a> h, <a href="Prelude.html#t:Read">Read</a> i) => <a href="Prelude.html#t:Read">Read</a> (a, b, c, d, e, f, g, h, i)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b, <a href="Prelude.html#t:Read">Read</a> c, <a href="Prelude.html#t:Read">Read</a> d, <a href="Prelude.html#t:Read">Read</a> e, <a href="Prelude.html#t:Read">Read</a> f, <a href="Prelude.html#t:Read">Read</a> g, <a href="Prelude.html#t:Read">Read</a> h, <a href="Prelude.html#t:Read">Read</a> i, <a href="Prelude.html#t:Read">Read</a> j) => <a href="Prelude.html#t:Read">Read</a> (a, b, c, d, e, f, g, h, i, j)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b, <a href="Prelude.html#t:Read">Read</a> c, <a href="Prelude.html#t:Read">Read</a> d, <a href="Prelude.html#t:Read">Read</a> e, <a href="Prelude.html#t:Read">Read</a> f, <a href="Prelude.html#t:Read">Read</a> g, <a href="Prelude.html#t:Read">Read</a> h, <a href="Prelude.html#t:Read">Read</a> i, <a href="Prelude.html#t:Read">Read</a> j, <a href="Prelude.html#t:Read">Read</a> k) => <a href="Prelude.html#t:Read">Read</a> (a, b, c, d, e, f, g, h, i, j, k)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b, <a href="Prelude.html#t:Read">Read</a> c, <a href="Prelude.html#t:Read">Read</a> d, <a href="Prelude.html#t:Read">Read</a> e, <a href="Prelude.html#t:Read">Read</a> f, <a href="Prelude.html#t:Read">Read</a> g, <a href="Prelude.html#t:Read">Read</a> h, <a href="Prelude.html#t:Read">Read</a> i, <a href="Prelude.html#t:Read">Read</a> j, <a href="Prelude.html#t:Read">Read</a> k, <a href="Prelude.html#t:Read">Read</a> l) => <a href="Prelude.html#t:Read">Read</a> (a, b, c, d, e, f, g, h, i, j, k, l)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b, <a href="Prelude.html#t:Read">Read</a> c, <a href="Prelude.html#t:Read">Read</a> d, <a href="Prelude.html#t:Read">Read</a> e, <a href="Prelude.html#t:Read">Read</a> f, <a href="Prelude.html#t:Read">Read</a> g, <a href="Prelude.html#t:Read">Read</a> h, <a href="Prelude.html#t:Read">Read</a> i, <a href="Prelude.html#t:Read">Read</a> j, <a href="Prelude.html#t:Read">Read</a> k, <a href="Prelude.html#t:Read">Read</a> l, <a href="Prelude.html#t:Read">Read</a> m) => <a href="Prelude.html#t:Read">Read</a> (a, b, c, d, e, f, g, h, i, j, k, l, m)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b, <a href="Prelude.html#t:Read">Read</a> c, <a href="Prelude.html#t:Read">Read</a> d, <a href="Prelude.html#t:Read">Read</a> e, <a href="Prelude.html#t:Read">Read</a> f, <a href="Prelude.html#t:Read">Read</a> g, <a href="Prelude.html#t:Read">Read</a> h, <a href="Prelude.html#t:Read">Read</a> i, <a href="Prelude.html#t:Read">Read</a> j, <a href="Prelude.html#t:Read">Read</a> k, <a href="Prelude.html#t:Read">Read</a> l, <a href="Prelude.html#t:Read">Read</a> m, <a href="Prelude.html#t:Read">Read</a> n) => <a href="Prelude.html#t:Read">Read</a> (a, b, c, d, e, f, g, h, i, j, k, l, m, n)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Prelude.html#t:Read">Read</a> a, <a href="Prelude.html#t:Read">Read</a> b, <a href="Prelude.html#t:Read">Read</a> c, <a href="Prelude.html#t:Read">Read</a> d, <a href="Prelude.html#t:Read">Read</a> e, <a href="Prelude.html#t:Read">Read</a> f, <a href="Prelude.html#t:Read">Read</a> g, <a href="Prelude.html#t:Read">Read</a> h, <a href="Prelude.html#t:Read">Read</a> i, <a href="Prelude.html#t:Read">Read</a> j, <a href="Prelude.html#t:Read">Read</a> k, <a href="Prelude.html#t:Read">Read</a> l, <a href="Prelude.html#t:Read">Read</a> m, <a href="Prelude.html#t:Read">Read</a> n, <a href="Prelude.html#t:Read">Read</a> o) => <a href="Prelude.html#t:Read">Read</a> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:reads" class="def">reads</a> :: <a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:ReadS">ReadS</a> a</p><div class="doc"><p>equivalent to <code><a href="Prelude.html#v:readsPrec">readsPrec</a></code> with a precedence of 0. </p></div></div><div class="top"><p class="src"><a name="v:readParen" class="def">readParen</a> :: <a href="Prelude.html#t:Bool">Bool</a> -> <a href="Prelude.html#t:ReadS">ReadS</a> a -> <a href="Prelude.html#t:ReadS">ReadS</a> a</p><div class="doc"><p><code><code><a href="Prelude.html#v:readParen">readParen</a></code> <code><a href="Prelude.html#v:True">True</a></code> p</code> parses what <code>p</code> parses, but surrounded with parentheses. </p><p><code><code><a href="Prelude.html#v:readParen">readParen</a></code> <code><a href="Prelude.html#v:False">False</a></code> p</code> parses what <code>p</code> parses, but optionally surrounded with parentheses. </p></div></div><div class="top"><p class="src"><a name="v:read" class="def">read</a> :: <a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:String">String</a> -> a</p><div class="doc"><p>The <code><a href="Prelude.html#v:read">read</a></code> function reads input from a string, which must be completely consumed by the input process. </p></div></div><div class="top"><p class="src"><a name="v:lex" class="def">lex</a> :: <a href="Prelude.html#t:ReadS">ReadS</a> <a href="Prelude.html#t:String">String</a></p><div class="doc"><p>The <code><a href="Prelude.html#v:lex">lex</a></code> function reads a single lexeme from the input, discarding initial white space, and returning the characters that constitute the lexeme. If the input string contains only white space, <code><a href="Prelude.html#v:lex">lex</a></code> returns a single successful `lexeme' consisting of the empty string. (Thus <code><code><a href="Prelude.html#v:lex">lex</a></code> "" = [("","")]</code>.) If there is no legal lexeme at the beginning of the input string, <code><a href="Prelude.html#v:lex">lex</a></code> fails (i.e. returns <code>[]</code>). </p><p>This lexer is not completely faithful to the Haskell lexical syntax in the following respects: </p><ul><li> Qualified names are not handled properly </li><li> Octal and hexadecimal numerics are not recognized as a single token </li><li> Comments are not treated properly </li></ul></div></div><h1 id="g:24">Basic Input and output </h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:IO" class="def">IO</a> a <a href="../ghc-prim-0.2.0.0/src/GHC-Types.html#IO" class="link">Source</a></p><div class="doc"><p>A value of type <code><code><a href="Prelude.html#t:IO">IO</a></code> a</code> is a computation which, when performed, does some I/O before returning a value of type <code>a</code>. </p><p>There is really only one way to "perform" an I/O action: bind it to <code>Main.main</code> in your program. When your program is run, the I/O will be performed. It isn't possible to perform I/O from an arbitrary function, unless that function is itself in the <code><a href="Prelude.html#t:IO">IO</a></code> monad and called at some point, directly or indirectly, from <code>Main.main</code>. </p><p><code><a href="Prelude.html#t:IO">IO</a></code> is a monad, so <code><a href="Prelude.html#t:IO">IO</a></code> actions can be combined using either the do-notation or the <code>>></code> and <code>>>=</code> operations from the <code>Monad</code> class. </p></div><div class="subs instances"><p id="control.i:IO" class="caption collapser" onclick="toggleSection('i:IO')">Instances</p><div id="section.i:IO" class="show"><table><tr><td class="src"><a href="Prelude.html#t:Monad">Monad</a> <a href="Prelude.html#t:IO">IO</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Functor">Functor</a> <a href="Prelude.html#t:IO">IO</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System-Event.html#t:IOCallback">IOCallback</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Data-Typeable.html#t:Typeable1">Typeable1</a> <a href="Prelude.html#t:IO">IO</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Monad-Fix.html#t:MonadFix">MonadFix</a> <a href="Prelude.html#t:IO">IO</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Applicative.html#t:Applicative">Applicative</a> <a href="Prelude.html#t:IO">IO</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Text-Printf.html#t:HPrintfType">HPrintfType</a> (<a href="Prelude.html#t:IO">IO</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Text-Printf.html#t:PrintfType">PrintfType</a> (<a href="Prelude.html#t:IO">IO</a> a)</td><td class="doc empty"> </td></tr></table></div></div></div><h2 id="g:25">Simple I/O operations </h2><h3 id="g:26">Output functions </h3><div class="top"><p class="src"><a name="v:putChar" class="def">putChar</a> :: <a href="Prelude.html#t:Char">Char</a> -> <a href="Prelude.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></p><div class="doc"><p>Write a character to the standard output device (same as <code><a href="GHC-IO-Handle.html#v:hPutChar">hPutChar</a></code> <code><a href="GHC-IO-Handle-FD.html#v:stdout">stdout</a></code>). </p></div></div><div class="top"><p class="src"><a name="v:putStr" class="def">putStr</a> :: <a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></p><div class="doc"><p>Write a string to the standard output device (same as <code><a href="GHC-IO-Handle.html#v:hPutStr">hPutStr</a></code> <code><a href="GHC-IO-Handle-FD.html#v:stdout">stdout</a></code>). </p></div></div><div class="top"><p class="src"><a name="v:putStrLn" class="def">putStrLn</a> :: <a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></p><div class="doc"><p>The same as <code><a href="Prelude.html#v:putStr">putStr</a></code>, but adds a newline character. </p></div></div><div class="top"><p class="src"><a name="v:print" class="def">print</a> :: <a href="Prelude.html#t:Show">Show</a> a => a -> <a href="Prelude.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></p><div class="doc"><p>The <code><a href="Prelude.html#v:print">print</a></code> function outputs a value of any printable type to the standard output device. Printable types are those that are instances of class <code><a href="Prelude.html#t:Show">Show</a></code>; <code><a href="Prelude.html#v:print">print</a></code> converts values to strings for output using the <code><a href="Prelude.html#v:show">show</a></code> operation and adds a newline. </p><p>For example, a program to print the first 20 integers and their powers of 2 could be written as: </p><pre> main = print ([(n, 2^n) | n <- [0..19]]) </pre></div></div><h3 id="g:27">Input functions </h3><div class="top"><p class="src"><a name="v:getChar" class="def">getChar</a> :: <a href="Prelude.html#t:IO">IO</a> <a href="Prelude.html#t:Char">Char</a></p><div class="doc"><p>Read a character from the standard input device (same as <code><a href="GHC-IO-Handle.html#v:hGetChar">hGetChar</a></code> <code><a href="GHC-IO-Handle-FD.html#v:stdin">stdin</a></code>). </p></div></div><div class="top"><p class="src"><a name="v:getLine" class="def">getLine</a> :: <a href="Prelude.html#t:IO">IO</a> <a href="Prelude.html#t:String">String</a></p><div class="doc"><p>Read a line from the standard input device (same as <code><a href="GHC-IO-Handle.html#v:hGetLine">hGetLine</a></code> <code><a href="GHC-IO-Handle-FD.html#v:stdin">stdin</a></code>). </p></div></div><div class="top"><p class="src"><a name="v:getContents" class="def">getContents</a> :: <a href="Prelude.html#t:IO">IO</a> <a href="Prelude.html#t:String">String</a></p><div class="doc"><p>The <code><a href="Prelude.html#v:getContents">getContents</a></code> operation returns all user input as a single string, which is read lazily as it is needed (same as <code><a href="GHC-IO-Handle.html#v:hGetContents">hGetContents</a></code> <code><a href="GHC-IO-Handle-FD.html#v:stdin">stdin</a></code>). </p></div></div><div class="top"><p class="src"><a name="v:interact" class="def">interact</a> :: (<a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:String">String</a>) -> <a href="Prelude.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></p><div class="doc"><p>The <code><a href="Prelude.html#v:interact">interact</a></code> function takes a function of type <code>String->String</code> as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device. </p></div></div><h3 id="g:28">Files </h3><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:FilePath" class="def">FilePath</a> = <a href="Prelude.html#t:String">String</a></p><div class="doc"><p>File and directory names are values of type <code><a href="Prelude.html#t:String">String</a></code>, whose precise meaning is operating system dependent. Files can be opened, yielding a handle which can then be used to operate on the contents of that file. </p></div></div><div class="top"><p class="src"><a name="v:readFile" class="def">readFile</a> :: <a href="Prelude.html#t:FilePath">FilePath</a> -> <a href="Prelude.html#t:IO">IO</a> <a href="Prelude.html#t:String">String</a></p><div class="doc"><p>The <code><a href="Prelude.html#v:readFile">readFile</a></code> function reads a file and returns the contents of the file as a string. The file is read lazily, on demand, as with <code><a href="Prelude.html#v:getContents">getContents</a></code>. </p></div></div><div class="top"><p class="src"><a name="v:writeFile" class="def">writeFile</a> :: <a href="Prelude.html#t:FilePath">FilePath</a> -> <a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></p><div class="doc"><p>The computation <code><a href="Prelude.html#v:writeFile">writeFile</a></code> <code>file str</code> function writes the string <code>str</code>, to the file <code>file</code>. </p></div></div><div class="top"><p class="src"><a name="v:appendFile" class="def">appendFile</a> :: <a href="Prelude.html#t:FilePath">FilePath</a> -> <a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></p><div class="doc"><p>The computation <code><a href="Prelude.html#v:appendFile">appendFile</a></code> <code>file str</code> function appends the string <code>str</code>, to the file <code>file</code>. </p><p>Note that <code><a href="Prelude.html#v:writeFile">writeFile</a></code> and <code><a href="Prelude.html#v:appendFile">appendFile</a></code> write a literal string to a file. To write a value of any printable type, as with <code><a href="Prelude.html#v:print">print</a></code>, use the <code><a href="Prelude.html#v:show">show</a></code> function to convert the value to a string first. </p><pre> main = appendFile "squares" (show [(x,x*x) | x <- [0,0.1..2]]) </pre></div></div><div class="top"><p class="src"><a name="v:readIO" class="def">readIO</a> :: <a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:IO">IO</a> a</p><div class="doc"><p>The <code><a href="Prelude.html#v:readIO">readIO</a></code> function is similar to <code><a href="Prelude.html#v:read">read</a></code> except that it signals parse failure to the <code><a href="Prelude.html#t:IO">IO</a></code> monad instead of terminating the program. </p></div></div><div class="top"><p class="src"><a name="v:readLn" class="def">readLn</a> :: <a href="Prelude.html#t:Read">Read</a> a => <a href="Prelude.html#t:IO">IO</a> a</p><div class="doc"><p>The <code><a href="Prelude.html#v:readLn">readLn</a></code> function combines <code><a href="Prelude.html#v:getLine">getLine</a></code> and <code><a href="Prelude.html#v:readIO">readIO</a></code>. </p></div></div><h2 id="g:29">Exception handling in the I/O monad </h2><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:IOError" class="def">IOError</a> = <a href="Control-Exception-Base.html#t:IOException">IOException</a></p><div class="doc"><p>The Haskell 98 type for exceptions in the <code><a href="Prelude.html#t:IO">IO</a></code> monad. Any I/O operation may raise an <code><a href="Prelude.html#t:IOError">IOError</a></code> instead of returning a result. For a more general type of exception, including also those that arise in pure code, see <a href="Control-Exception-Exception.html">Control.Exception.Exception</a>. </p><p>In Haskell 98, this is an opaque type. </p></div></div><div class="top"><p class="src"><a name="v:ioError" class="def">ioError</a> :: <a href="Prelude.html#t:IOError">IOError</a> -> <a href="Prelude.html#t:IO">IO</a> a</p><div class="doc"><p>Raise an <code><a href="Prelude.html#t:IOError">IOError</a></code> in the <code><a href="Prelude.html#t:IO">IO</a></code> monad. </p></div></div><div class="top"><p class="src"><a name="v:userError" class="def">userError</a> :: <a href="Prelude.html#t:String">String</a> -> <a href="Prelude.html#t:IOError">IOError</a></p><div class="doc"><p>Construct an <code><a href="Prelude.html#t:IOError">IOError</a></code> value with a string describing the error. The <code><a href="Prelude.html#v:fail">fail</a></code> method of the <code><a href="Prelude.html#t:IO">IO</a></code> instance of the <code><a href="Prelude.html#t:Monad">Monad</a></code> class raises a <code><a href="Prelude.html#v:userError">userError</a></code>, thus: </p><pre> instance Monad IO where ... fail s = ioError (userError s) </pre></div></div><div class="top"><p class="src"><a name="v:catch" class="def">catch</a> :: <a href="Prelude.html#t:IO">IO</a> a -> (<a href="Prelude.html#t:IOError">IOError</a> -> <a href="Prelude.html#t:IO">IO</a> a) -> <a href="Prelude.html#t:IO">IO</a> a</p><div class="doc"><p>The <code><a href="Prelude.html#v:catch">catch</a></code> function establishes a handler that receives any <code><a href="Prelude.html#t:IOError">IOError</a></code> raised in the action protected by <code><a href="Prelude.html#v:catch">catch</a></code>. An <code><a href="Prelude.html#t:IOError">IOError</a></code> is caught by the most recent handler established by <code><a href="Prelude.html#v:catch">catch</a></code>. These handlers are not selective: all <code><a href="Prelude.html#t:IOError">IOError</a></code>s are caught. Exception propagation must be explicitly provided in a handler by re-raising any unwanted exceptions. For example, in </p><pre> f = catch g (\e -> if IO.isEOFError e then return [] else ioError e) </pre><p>the function <code>f</code> returns <code>[]</code> when an end-of-file exception (cf. <code><a href="System-IO-Error.html#v:isEOFError">isEOFError</a></code>) occurs in <code>g</code>; otherwise, the exception is propagated to the next outer handler. </p><p>When an exception propagates outside the main program, the Haskell system prints the associated <code><a href="Prelude.html#t:IOError">IOError</a></code> value and exits the program. </p><p>Non-I/O exceptions are not caught by this variant; to catch all exceptions, use <code>Control.Exception.catch</code> from <a href="Control-Exception.html">Control.Exception</a>. </p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.9.2</p></div></body></html>