<!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>Ix</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_Ix.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">haskell98-2.0.0.1: Compatibility with Haskell 98</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">Ix</p></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">class</span> <a href="Prelude.html#t:Ord">Ord</a> a => <a href="#t:Ix">Ix</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:range">range</a> :: (a, a) -> [a]</li><li><a href="#v:index">index</a> :: (a, a) -> a -> <a href="Prelude.html#t:Int">Int</a></li><li><a href="#v:inRange">inRange</a> :: (a, a) -> a -> <a href="Prelude.html#t:Bool">Bool</a></li><li><a href="#v:rangeSize">rangeSize</a> :: (a, a) -> <a href="Prelude.html#t:Int">Int</a></li></ul></li><li class="src short"><a href="#v:rangeSize">rangeSize</a> :: <a href="Ix.html#t:Ix">Ix</a> a => (a, a) -> <a href="Prelude.html#t:Int">Int</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">class</span> <a href="Prelude.html#t:Ord">Ord</a> a => <a name="t:Ix" class="def">Ix</a> a <span class="keyword">where</span><a href="../base-4.5.1.0/src/GHC-Arr.html#Ix" class="link">Source</a></p><div class="doc"><p>The <code><a href="Ix.html#t:Ix">Ix</a></code> class is used to map a contiguous subrange of values in a type onto integers. It is used primarily for array indexing (see the array package). </p><p>The first argument <code>(l,u)</code> of each of these operations is a pair specifying the lower and upper bounds of a contiguous subrange of values. </p><p>An implementation is entitled to assume the following laws about these operations: </p><ul><li> <code><code><a href="Ix.html#v:inRange">inRange</a></code> (l,u) i == <code><a href="Prelude.html#v:elem">elem</a></code> i (<code><a href="Ix.html#v:range">range</a></code> (l,u))</code> <code> </code> </li><li> <code><code><a href="Ix.html#v:range">range</a></code> (l,u) <code><a href="Prelude.html#v:-33--33-">!!</a></code> <code><a href="Ix.html#v:index">index</a></code> (l,u) i == i</code>, when <code><code><a href="Ix.html#v:inRange">inRange</a></code> (l,u) i</code> </li><li> <code><code><a href="Prelude.html#v:map">map</a></code> (<code><a href="Ix.html#v:index">index</a></code> (l,u)) (<code><a href="Ix.html#v:range">range</a></code> (l,u))) == [0..<code><a href="Ix.html#v:rangeSize">rangeSize</a></code> (l,u)-1]</code> <code> </code> </li><li> <code><code><a href="Ix.html#v:rangeSize">rangeSize</a></code> (l,u) == <code><a href="Prelude.html#v:length">length</a></code> (<code><a href="Ix.html#v:range">range</a></code> (l,u))</code> <code> </code> </li></ul><p>Minimal complete instance: <code><a href="Ix.html#v:range">range</a></code>, <code><a href="Ix.html#v:index">index</a></code> and <code><a href="Ix.html#v:inRange">inRange</a></code>. </p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:range" class="def">range</a> :: (a, a) -> [a]<a href="../base-4.5.1.0/src/GHC-Arr.html#range" class="link">Source</a></p><div class="doc"><p>The list of values in the subrange defined by a bounding pair. </p></div><p class="src"><a name="v:index" class="def">index</a> :: (a, a) -> a -> <a href="Prelude.html#t:Int">Int</a><a href="../base-4.5.1.0/src/GHC-Arr.html#index" class="link">Source</a></p><div class="doc"><p>The position of a subscript in the subrange. </p></div><p class="src"><a name="v:inRange" class="def">inRange</a> :: (a, a) -> a -> <a href="Prelude.html#t:Bool">Bool</a><a href="../base-4.5.1.0/src/GHC-Arr.html#inRange" class="link">Source</a></p><div class="doc"><p>Returns <code><a href="Prelude.html#v:True">True</a></code> the given subscript lies in the range defined the bounding pair. </p></div><p class="src"><a name="v:rangeSize" class="def">rangeSize</a> :: (a, a) -> <a href="Prelude.html#t:Int">Int</a><a href="../base-4.5.1.0/src/GHC-Arr.html#rangeSize" class="link">Source</a></p><div class="doc"><p>The size of the subrange defined by a bounding pair. </p></div></div><div class="subs instances"><p id="control.i:Ix" class="caption collapser" onclick="toggleSection('i:Ix')">Instances</p><div id="section.i:Ix" class="show"><table><tr><td class="src"><a href="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="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="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="Ix.html#t:Ix">Ix</a> <a href="../base-4.5.1.0/Data-Int.html#t:Int8">Int8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Ix.html#t:Ix">Ix</a> <a href="../base-4.5.1.0/Data-Int.html#t:Int16">Int16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Ix.html#t:Ix">Ix</a> <a href="../base-4.5.1.0/Data-Int.html#t:Int32">Int32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Ix.html#t:Ix">Ix</a> <a href="../base-4.5.1.0/Data-Int.html#t:Int64">Int64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="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="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="Ix.html#t:Ix">Ix</a> ()</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Ix.html#t:Ix">Ix</a> <a href="../base-4.5.1.0/Data-Char.html#t:GeneralCategory">GeneralCategory</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Ix.html#t:Ix">Ix</a> <a href="IO.html#t:SeekMode">SeekMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Ix.html#t:Ix">Ix</a> <a href="IO.html#t:IOMode">IOMode</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Ix.html#t:Ix">Ix</a> <a href="Time.html#t:Month">Month</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Ix.html#t:Ix">Ix</a> <a href="Time.html#t:Day">Day</a></td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Ix.html#t:Ix">Ix</a> a, <a href="Ix.html#t:Ix">Ix</a> b) => <a href="Ix.html#t:Ix">Ix</a> (a, b)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Ix.html#t:Ix">Ix</a> a1, <a href="Ix.html#t:Ix">Ix</a> a2, <a href="Ix.html#t:Ix">Ix</a> a3) => <a href="Ix.html#t:Ix">Ix</a> (a1, a2, a3)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Ix.html#t:Ix">Ix</a> a1, <a href="Ix.html#t:Ix">Ix</a> a2, <a href="Ix.html#t:Ix">Ix</a> a3, <a href="Ix.html#t:Ix">Ix</a> a4) => <a href="Ix.html#t:Ix">Ix</a> (a1, a2, a3, a4)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Ix.html#t:Ix">Ix</a> a1, <a href="Ix.html#t:Ix">Ix</a> a2, <a href="Ix.html#t:Ix">Ix</a> a3, <a href="Ix.html#t:Ix">Ix</a> a4, <a href="Ix.html#t:Ix">Ix</a> a5) => <a href="Ix.html#t:Ix">Ix</a> (a1, a2, a3, a4, a5)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:rangeSize" class="def">rangeSize</a> :: <a href="Ix.html#t:Ix">Ix</a> a => (a, a) -> <a href="Prelude.html#t:Int">Int</a><a href="../base-4.5.1.0/src/GHC-Arr.html#rangeSize" class="link">Source</a></p><div class="doc"><p>The size of the subrange defined by a bounding pair. </p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.11.0</p></div></body></html>