X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Data%2FIx.hs;h=a01e5162659af6e8dd4aa525a7b3900c3009a1ec;hb=HEAD;hp=f9ce182b4723111d3e3ee856202ab8010c824080;hpb=9998ccb135e022aee442d32bf1f9e723a2256887;p=ghc-base.git diff --git a/Data/Ix.hs b/Data/Ix.hs index f9ce182..a01e516 100644 --- a/Data/Ix.hs +++ b/Data/Ix.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + ----------------------------------------------------------------------------- -- | -- Module : Data.Ix @@ -16,12 +18,12 @@ 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