X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Data%2FIx.hs;h=a01e5162659af6e8dd4aa525a7b3900c3009a1ec;hb=41e8fba828acbae1751628af50849f5352b27873;hp=6af2c19e355bfc94fdb8d041a59c29a5655ddb8e;hpb=7e8c7becf29c0fd359ff7e205b60df3ef4b920fb;p=ghc-base.git diff --git a/Data/Ix.hs b/Data/Ix.hs index 6af2c19..a01e516 100644 --- a/Data/Ix.hs +++ b/Data/Ix.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + ----------------------------------------------------------------------------- -- | -- Module : Data.Ix @@ -10,18 +12,18 @@ -- -- The 'Ix' class is used to map a contiguous subrange of values in -- type onto integers. It is used primarily for array indexing --- (see "Data.Array", "Data.Array.IArray" and "Data.Array.MArray"). +-- (see the array package). -- ----------------------------------------------------------------------------- module Data.Ix ( -- * The 'Ix' class - Ix - ( range -- :: (Ix a) => (a,a) -> [a] - , index -- :: (Ix a) => (a,a) -> a -> Int - , inRange -- :: (Ix a) => (a,a) -> a -> Bool - , rangeSize -- :: (Ix a) => (a,a) -> Int - ) + Ix + ( range -- :: (Ix a) => (a,a) -> [a] + , index -- :: (Ix a) => (a,a) -> a -> Int + , inRange -- :: (Ix a) => (a,a) -> a -> Bool + , rangeSize -- :: (Ix a) => (a,a) -> Int + ) -- Ix instances: -- -- Ix Char @@ -46,13 +48,13 @@ module Data.Ix -- is the same numbering defined by the 'Enum' class. For example, given -- the datatype: -- - -- > data Colour = Red | Orange | Yellow | Green | Blue | Indigo | Violet + -- > data Colour = Red | Orange | Yellow | Green | Blue | Indigo | Violet -- -- we would have: -- - -- > range (Yellow,Blue) == [Yellow,Green,Blue] - -- > index (Yellow,Blue) Green == 1 - -- > inRange (Yellow,Blue) Red == False + -- > range (Yellow,Blue) == [Yellow,Green,Blue] + -- > index (Yellow,Blue) Green == 1 + -- > inRange (Yellow,Blue) Red == False -- -- * For single-constructor datatypes, the derived instance declarations -- are as shown for tuples in Figure 1 @@ -60,7 +62,7 @@ module Data.Ix ) where -import Prelude +-- import Prelude #ifdef __GLASGOW_HASKELL__ import GHC.Arr