d2022edfd2dfc7a98d71424baff7dd2388506230
[ghc-base.git] / Data / Ix.hs
1 -----------------------------------------------------------------------------
2 -- |
3 -- Module      :  Data.Ix
4 -- Copyright   :  (c) The University of Glasgow 2001
5 -- License     :  BSD-style (see the file libraries/core/LICENSE)
6 -- 
7 -- Maintainer  :  libraries@haskell.org
8 -- Stability   :  provisional
9 -- Portability :  portable
10 --
11 -- Class of index types.
12 --
13 -----------------------------------------------------------------------------
14
15 module Data.Ix
16     (
17         Ix
18           ( range       -- :: (Ix a) => (a,a) -> [a]
19           , index       -- :: (Ix a) => (a,a) -> a   -> Int
20           , inRange     -- :: (Ix a) => (a,a) -> a   -> Bool
21           , rangeSize   -- :: (Ix a) => (a,a) -> Int
22           )
23     -- Ix instances:
24     --
25     --  Ix Char
26     --  Ix Int
27     --  Ix Integer
28     --  Ix Bool
29     --  Ix Ordering
30     --  Ix ()
31     --  (Ix a, Ix b) => Ix (a, b)
32     --  ...
33
34     -- Implementation checked wrt. Haskell 98 lib report, 1/99.
35     ) where
36
37 import Prelude
38
39 #ifdef __GLASGOW_HASKELL__
40 import GHC.Arr
41 #endif