-
Notifications
You must be signed in to change notification settings - Fork 0
/
Eta-Prelude-Classes-Enum.html
30 lines (30 loc) · 5.77 KB
/
Eta-Prelude-Classes-Enum.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!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>Eta.Prelude.Classes.Enum</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Eta-Prelude-Classes-Enum.html");};
//]]>
</script></head><body class="no-frame"><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 empty"> </p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>Safe</td></tr></table><p class="caption">Eta.Prelude.Classes.Enum</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>The <code>Enum</code> class defines operations on
sequentially ordered types</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:successor">successor</a> :: Enum a => a -> a</li><li class="src short"><a href="#v:predecessor">predecessor</a> :: Enum a => a -> a</li><li class="src short"><a href="#v:toEnumeration">toEnumeration</a> :: Enum a => Int -> a</li><li class="src short"><a href="#v:fromEnumeration">fromEnumeration</a> :: Enum a => a -> Int</li><li class="src short"><a href="#v:enumerateFrom">enumerateFrom</a> :: Enum a => a -> [a]</li><li class="src short"><a href="#v:steppingEnumerateFrom">steppingEnumerateFrom</a> :: Enum a => a -> a -> [a]</li><li class="src short"><a href="#v:enumerateFromTo">enumerateFromTo</a> :: Enum a => a -> a -> [a]</li><li class="src short"><a href="#v:steppingEnumerateFromTo">steppingEnumerateFromTo</a> :: Enum a => a -> a -> a -> [a]</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a id="v:successor" class="def">successor</a> :: Enum a => a -> a <a href="#v:successor" class="selflink">#</a></p><div class="doc"><p>Successor of a value</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>successor 1
</code></strong>2
</pre></div></div><div class="top"><p class="src"><a id="v:predecessor" class="def">predecessor</a> :: Enum a => a -> a <a href="#v:predecessor" class="selflink">#</a></p><div class="doc"><p>Predecessor of a value</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>predecessor 1
</code></strong>0
</pre></div></div><div class="top"><p class="src"><a id="v:toEnumeration" class="def">toEnumeration</a> :: Enum a => Int -> a <a href="#v:toEnumeration" class="selflink">#</a></p><div class="doc"><p>Converts an <code>Int</code> into the equivalent value
of the enumeration</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>toEnumeration 1 :: Bool
</code></strong>True
</pre></div></div><div class="top"><p class="src"><a id="v:fromEnumeration" class="def">fromEnumeration</a> :: Enum a => a -> Int <a href="#v:fromEnumeration" class="selflink">#</a></p><div class="doc"><p>Converts a value from an enumeration into the
equivalent <code>Int</code> value</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>fromEnumeration False
</code></strong>0
</pre></div></div><div class="top"><p class="src"><a id="v:enumerateFrom" class="def">enumerateFrom</a> :: Enum a => a -> [a] <a href="#v:enumerateFrom" class="selflink">#</a></p><div class="doc"><p>Generates a list from the beginning
of the type to the end</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>take 4 (enumerateFrom 0)
</code></strong>[0,1,2,3]
<code class="prompt">>>> </code><strong class="userinput"><code>enumerateFrom False
</code></strong>[False,True]
</pre></div></div><div class="top"><p class="src"><a id="v:steppingEnumerateFrom" class="def">steppingEnumerateFrom</a> :: Enum a => a -> a -> [a] <a href="#v:steppingEnumerateFrom" class="selflink">#</a></p><div class="doc"><p>Generates a list from the beginning
of the type to the end, with steps</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>take 4 (steppingEnumerateFrom 0 2)
</code></strong>[0,2,4,6]
</pre></div></div><div class="top"><p class="src"><a id="v:enumerateFromTo" class="def">enumerateFromTo</a> :: Enum a => a -> a -> [a] <a href="#v:enumerateFromTo" class="selflink">#</a></p><div class="doc"><p>Generates a list from the beginning
of the type to the specified limit</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>enumerateFromTo 0 3
</code></strong>[0,1,2,3]
</pre></div></div><div class="top"><p class="src"><a id="v:steppingEnumerateFromTo" class="def">steppingEnumerateFromTo</a> :: Enum a => a -> a -> a -> [a] <a href="#v:steppingEnumerateFromTo" class="selflink">#</a></p><div class="doc"><p>Generates a list from the beginning
of the type to the specified limit,
with steps</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>steppingEnumerateFromTo 0 2 8
</code></strong>[0,2,4,6,8]
</pre></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.4</p></div></body></html>