Commits

dafis committed e75ca2d

Conditionally import GHC.Word/Data.Word only for GHC < 7.5, it's available from GHC.Base for >= 7.5

Comments (0)

Files changed (8)

Math/NumberTheory/GCD/LowLevel.hs

 -- Normally, accessing these via the higher level interface of "Math.NumberTheory.GCD"
 -- should be sufficient.
 --
-{-# LANGUAGE MagicHash, UnboxedTuples #-}
+{-# LANGUAGE CPP, MagicHash, UnboxedTuples #-}
 module Math.NumberTheory.GCD.LowLevel
   ( -- * Specialised GCDs
     gcdInt
   ) where
 
 import GHC.Base
-import GHC.Word (Word(..))
+#if __GLASGOW_HASKELL__ < 705
+import GHC.Word (Word(..))      -- Moved to GHC.Types
+#endif
 
 import Math.NumberTheory.Utils
 

Math/NumberTheory/Logarithms.hs

 -- Integer Logarithms. For efficiency, the internal representation of 'Integer's
 -- from integer-gmp is used.
 --
-{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE CPP, MagicHash #-}
 module Math.NumberTheory.Logarithms
     ( -- * Integer logarithms with input checks
       integerLogBase
     ) where
 
 import GHC.Base
-import GHC.Word (Word(..))
+#if __GLASGOW_HASKELL__ < 705
+import GHC.Word (Word(..))      -- Moved to GHC.Types
+#endif
 
 import Data.Bits
 import Data.Array.Unboxed

Math/NumberTheory/Powers/Fourth.hs

 import Data.Array.Base (unsafeAt, unsafeWrite)
 
 import Data.Bits
+#if __GLASGOW_HASKELL__ < 705
 import Data.Word
+#endif
 
 import Math.NumberTheory.Logarithms.Internal (integerLog2#)
 

Math/NumberTheory/Powers/General.hs

 import GHC.Integer.GMP.Internals
 
 import Data.Bits
+#if __GLASGOW_HASKELL__ < 705
 import Data.Word
+#endif
 import Data.List (foldl')
 import qualified Data.Set as Set
 

Math/NumberTheory/Powers/Squares.hs

 import Data.Array.Base (unsafeAt, unsafeWrite)
 
 import Data.Bits
-import Data.Word
+#if __GLASGOW_HASKELL__ < 705
+import Data.Word        -- Moved to GHC.Types
+#endif
 
 import Math.NumberTheory.Logarithms.Internal (integerLog2#)
 

Math/NumberTheory/Primes/Factorisation/Montgomery.hs

 #include "MachDeps.h"
 
 import GHC.Base
-import GHC.Word
+#if __GLASGOW_HASKELL__ < 705
+import GHC.Word     -- Moved to GHC.Types
+#endif
 import Data.Array.Base
 
 import System.Random

Math/NumberTheory/Primes/Testing/Probabilistic.hs

 import Data.Bits
 
 import GHC.Base
-import GHC.Word
+#if __GLASGOW_HASKELL__ < 705
+import GHC.Word     -- Moved to GHC.Types
+#endif
 import GHC.Integer.GMP.Internals
 
 -- | @'isPrime' n@ tests whether @n@ is a prime (negative or positive).

Math/NumberTheory/Utils.hs

 #include "MachDeps.h"
 
 import GHC.Base
-import GHC.Word
+#if __GLASGOW_HASKELL__ < 705
+import GHC.Word     -- Word and its constructor moved to GHC.Types
+#endif
 
 import GHC.Integer
 import GHC.Integer.GMP.Internals