| 1 | Wed Aug 26 19:43:32 EDT 2009 pumpkingod@gmail.com |
|---|
| 2 | * Add testBitInteger for compatibility with the new gmp bindings in integer-gmp |
|---|
| 3 | |
|---|
| 4 | New patches: |
|---|
| 5 | |
|---|
| 6 | [Add testBitInteger for compatibility with the new gmp bindings in integer-gmp |
|---|
| 7 | pumpkingod@gmail.com**20090826234332 |
|---|
| 8 | Ignore-this: a4d98459359bf9e9b130384d42803bd3 |
|---|
| 9 | ] { |
|---|
| 10 | hunk ./GHC/Integer.hs 38 |
|---|
| 11 | -- gcdInteger, lcmInteger, -- XXX |
|---|
| 12 | andInteger, orInteger, xorInteger, complementInteger, |
|---|
| 13 | shiftLInteger, shiftRInteger, |
|---|
| 14 | + testBitInteger, |
|---|
| 15 | hashInteger, |
|---|
| 16 | ) where |
|---|
| 17 | |
|---|
| 18 | hunk ./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 | |
|---|
| 32 | Context: |
|---|
| 33 | |
|---|
| 34 | [Add NoImplicitPrelude to the extensions used |
|---|
| 35 | Ian Lynagh <igloo@earth.li>**20090722174729] |
|---|
| 36 | [Add an import so the deps get sorted out correctly |
|---|
| 37 | Ian Lynagh <igloo@earth.li>**20090722162843] |
|---|
| 38 | [() is now available, so use that instead of our own |
|---|
| 39 | Ian Lynagh <igloo@earth.li>**20090722161829] |
|---|
| 40 | [Follow changes in GHC and the other libraries |
|---|
| 41 | Ian Lynagh <igloo@earth.li>**20090722131507] |
|---|
| 42 | [Fix conversions between Float/Double and simple-integer |
|---|
| 43 | Ian Lynagh <igloo@earth.li>**20080614152452] |
|---|
| 44 | [Sprinkle on some strictness annotations |
|---|
| 45 | Ian Lynagh <igloo@earth.li>**20080602193146] |
|---|
| 46 | [Make the Integer type components strict |
|---|
| 47 | Ian Lynagh <igloo@earth.li>**20080602185149] |
|---|
| 48 | [Avoid the need for infinite Integers when doing bitwise operations |
|---|
| 49 | Ian Lynagh <igloo@earth.li>**20080602184237] |
|---|
| 50 | [Initial commit |
|---|
| 51 | Ian Lynagh <igloo@earth.li>**20080425024824] |
|---|
| 52 | Patch bundle hash: |
|---|
| 53 | 1bbb0fbe896450bc022c23cde1188a7f1102255b |
|---|