[commit: base] master: Use testBitInteger; part of #3489. patch from pumpkingod at gmail.com (e8a0c5b)
Ian Lynagh
igloo at earth.li
Sun Aug 5 17:39:31 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/base
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/e8a0c5b872302e7f800ba67667a3622baabed140
>---------------------------------------------------------------
commit e8a0c5b872302e7f800ba67667a3622baabed140
Author: Ian Lynagh <ian at well-typed.com>
Date: Sun Aug 5 15:54:15 2012 +0100
Use testBitInteger; part of #3489. patch from pumpkingod at gmail.com
>---------------------------------------------------------------
Data/Bits.hs | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Data/Bits.hs b/Data/Bits.hs
index 14a6357..6d97352 100644
--- a/Data/Bits.hs
+++ b/Data/Bits.hs
@@ -386,6 +386,7 @@ instance Bits Integer where
complement = complementInteger
shift x i@(I# i#) | i >= 0 = shiftLInteger x i#
| otherwise = shiftRInteger x (negateInt# i#)
+ testBit x (I# i) = testBitInteger x i
#else
-- reduce bitwise binary operations to special cases we can handle
@@ -404,10 +405,10 @@ instance Bits Integer where
complement a = -1 - a
shift x i | i >= 0 = x * 2^i
| otherwise = x `div` 2^(-i)
+ testBit = testBitDefault
#endif
bit = bitDefault
- testBit = testBitDefault
popCount = popCountDefault
rotate x i = shift x i -- since an Integer never wraps around
More information about the Cvs-libraries
mailing list