diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-07-30 17:30:09 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-08-05 03:59:27 -0400 |
commit | d613ed7624cbf39192d2a8cf29ab0c0fd2980a15 (patch) | |
tree | 1964352c495487b60af77aff5b5c2379019e4ac9 /libraries/integer-gmp/src | |
parent | ef2ae81a394df573510b12b7e11bba0c931249d8 (diff) | |
download | haskell-d613ed7624cbf39192d2a8cf29ab0c0fd2980a15.tar.gz |
Bignum: add backward compat integer-gmp functions
Also enhance bigNatCheck# and isValidNatural test
Diffstat (limited to 'libraries/integer-gmp/src')
-rw-r--r-- | libraries/integer-gmp/src/GHC/Integer/GMP/Internals.hs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libraries/integer-gmp/src/GHC/Integer/GMP/Internals.hs b/libraries/integer-gmp/src/GHC/Integer/GMP/Internals.hs index f754e42862..ebd0e0f6d7 100644 --- a/libraries/integer-gmp/src/GHC/Integer/GMP/Internals.hs +++ b/libraries/integer-gmp/src/GHC/Integer/GMP/Internals.hs @@ -42,12 +42,20 @@ module GHC.Integer.GMP.Internals , GmpLimb, GmpLimb# , GmpSize, GmpSize# + -- ** + + , isValidBigNat# + , sizeofBigNat# + , zeroBigNat + , oneBigNat + ) where import GHC.Integer import GHC.Natural import GHC.Num.Integer (Integer(..)) import qualified GHC.Num.Integer as I +import qualified GHC.Num.BigNat as B import GHC.Types import GHC.Prim @@ -112,3 +120,19 @@ type GmpLimb = Word type GmpLimb# = Word# type GmpSize = Int type GmpSize# = Int# + +{-# DEPRECATED sizeofBigNat# "Use bigNatSize# instead" #-} +sizeofBigNat# :: BigNat -> GmpSize# +sizeofBigNat# (BN# i) = B.bigNatSize# i + +{-# DEPRECATED isValidBigNat# "Use bigNatCheck# instead" #-} +isValidBigNat# :: BigNat -> Int# +isValidBigNat# (BN# i) = B.bigNatCheck# i + +{-# DEPRECATED zeroBigNat "Use bigNatZero instead" #-} +zeroBigNat :: BigNat +zeroBigNat = B.bigNatZero + +{-# DEPRECATED oneBigNat "Use bigNatOne instead" #-} +oneBigNat :: BigNat +oneBigNat = B.bigNatOne |