Ticket #3489: integer-simple.patch

File integer-simple.patch, 1.9 KB (added by pumpkin, 4 years ago)
Line 
1Wed Aug 26 19:43:32 EDT 2009  pumpkingod@gmail.com
2  * Add testBitInteger for compatibility with the new gmp bindings in integer-gmp
3
4New patches:
5
6[Add testBitInteger for compatibility with the new gmp bindings in integer-gmp
7pumpkingod@gmail.com**20090826234332
8 Ignore-this: a4d98459359bf9e9b130384d42803bd3
9] {
10hunk ./GHC/Integer.hs 38
11     -- gcdInteger, lcmInteger, -- XXX
12     andInteger, orInteger, xorInteger, complementInteger,
13     shiftLInteger, shiftRInteger,
14+    testBitInteger,
15     hashInteger,
16  ) where
17 
18hunk ./GHC/Integer.hs 287
19     = complementInteger (shiftRInteger (complementInteger j) i)
20 shiftRInteger Naught         _ = Naught
21 
22+-- XXX this could be a lot more efficient, but this is a quick reimplementation
23+-- default Data.Bits instance so we can retain compatibility with integer-gmp
24+testBitInteger :: Integer -> Int# -> Bool
25+testBitInteger x i = (x `andInteger` (smallInteger 1# `shiftLInteger` i)) `neqInteger` smallInteger 0#
26+
27 twosComplementPositive :: Positive -> DigitsOnes
28 twosComplementPositive p = flipBits (p `minusPositive` onePositive)
29 
30}
31
32Context:
33
34[Add NoImplicitPrelude to the extensions used
35Ian Lynagh <igloo@earth.li>**20090722174729]
36[Add an import so the deps get sorted out correctly
37Ian Lynagh <igloo@earth.li>**20090722162843]
38[() is now available, so use that instead of our own
39Ian Lynagh <igloo@earth.li>**20090722161829]
40[Follow changes in GHC and the other libraries
41Ian Lynagh <igloo@earth.li>**20090722131507]
42[Fix conversions between Float/Double and simple-integer
43Ian Lynagh <igloo@earth.li>**20080614152452]
44[Sprinkle on some strictness annotations
45Ian Lynagh <igloo@earth.li>**20080602193146]
46[Make the Integer type components strict
47Ian Lynagh <igloo@earth.li>**20080602185149]
48[Avoid the need for infinite Integers when doing bitwise operations
49Ian Lynagh <igloo@earth.li>**20080602184237]
50[Initial commit
51Ian Lynagh <igloo@earth.li>**20080425024824]
52Patch bundle hash:
531bbb0fbe896450bc022c23cde1188a7f1102255b