[commit: integer-simple] master: Fix build (b681077)

Ian Lynagh igloo at earth.li
Sun May 19 19:32:14 CEST 2013


Repository : ssh://darcs.haskell.org//srv/darcs/packages/integer-simple

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/b681077b59fb63833709db79737ec0a4e8a02b49

>---------------------------------------------------------------

commit b681077b59fb63833709db79737ec0a4e8a02b49
Author: Ian Lynagh <ian at well-typed.com>
Date:   Sun May 19 17:45:37 2013 +0100

    Fix build
    
    If we use "smallInteger 0#" in the definitions, then that turns into
    an Integer literal, but the compiler can't handle Integer literals
    while compiling the integer package (as it can't look up the
    mkInteger Id yet).

>---------------------------------------------------------------

 GHC/Integer/Type.hs |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/GHC/Integer/Type.hs b/GHC/Integer/Type.hs
index ee2c08f..f87f1c3 100644
--- a/GHC/Integer/Type.hs
+++ b/GHC/Integer/Type.hs
@@ -318,8 +318,8 @@ shiftRInteger Naught         _ = Naught
 -- reimplementation of the default Data.Bits instance, so that we can
 -- implement the Integer interface
 testBitInteger :: Integer -> Int# -> Bool
-testBitInteger x i = (x `andInteger` (smallInteger 1# `shiftLInteger` i))
-        `neqInteger` smallInteger 0#
+testBitInteger x i = (x `andInteger` (oneInteger `shiftLInteger` i))
+        `neqInteger` Naught
 
 twosComplementPositive :: Positive -> DigitsOnes
 twosComplementPositive p = flipBits (p `minusPositive` onePositive)





More information about the ghc-commits mailing list