-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Integer library based on GMP
--   
--   This package used to provide an implementation of the standard
--   <a>Integer</a> type based on the <a>GNU Multiple Precision Arithmetic
--   Library (GMP)</a>.
--   
--   It is now deprecated in favor of the 'ghc-bignum' package.
--   
--   Its purpose is to provide backward compatibility for codes directly
--   depending on the `integer-gmp` package.
@package integer-gmp
@version 1.1


module GHC.Integer.GMP.Internals

-- | Arbitrary precision integers. In contrast with fixed-size integral
--   types such as <a>Int</a>, the <a>Integer</a> type represents the
--   entire infinite range of integers.
--   
--   Integers are stored in a kind of sign-magnitude form, hence do not
--   expect two's complement form when using bit operations.
--   
--   If the value is small (fit into an <a>Int</a>), <a>IS</a> constructor
--   is used. Otherwise <a>Integer</a> and <a>IN</a> constructors are used
--   to store a <a>BigNat</a> representing respectively the positive or the
--   negative value magnitude.
--   
--   Invariant: <a>Integer</a> and <a>IN</a> are used iff value doesn't fit
--   in <a>IS</a>
data Integer

-- | <i>Deprecated: Use IS constructor instead</i>
pattern S# :: Int# -> Integer

-- | <i>Deprecated: Use IN constructor instead</i>
pattern Jn# :: BigNat -> Integer

-- | <i>Deprecated: Use IP constructor instead</i>
pattern Jp# :: BigNat -> Integer

-- | <i>Deprecated: Use integerCheck# instead</i>
isValidInteger# :: Integer -> Int#

-- | <i>Deprecated: Use integerGcd instead</i>
gcdInteger :: Integer -> Integer -> Integer

-- | <i>Deprecated: Use integerGcde instead</i>
gcdExtInteger :: Integer -> Integer -> (# Integer, Integer #)

-- | <i>Deprecated: Use integerLcm instead</i>
lcmInteger :: Integer -> Integer -> Integer

-- | <i>Deprecated: Use integerSqr instead</i>
sqrInteger :: Integer -> Integer

-- | <i>Deprecated: Use integerPowMod# instead</i>
powModInteger :: Integer -> Integer -> Integer -> Integer

-- | <i>Deprecated: Use integerRecipMod# instead</i>
recipModInteger :: Integer -> Integer -> Integer

-- | <i>Deprecated: Use integerFromWordNeg# instead</i>
wordToNegInteger :: Word# -> Integer

-- | <i>Deprecated: Use integerFromBigNat# instead</i>
bigNatToInteger :: BigNat -> Integer

-- | <i>Deprecated: Use integerFromBigNatNeg# instead</i>
bigNatToNegInteger :: BigNat -> Integer

-- | A lifted BigNat
--   
--   Represented as an array of limbs (Word themselves use machine order).
--   
--   Invariant (canonical representation): higher Word# is non-zero.
--   
--   As a consequence, zero is represented with a WordArray# whose size is
--   0.
data BigNat
BN# :: BigNat# -> BigNat
[unBigNat] :: BigNat -> BigNat#
type GmpLimb = Word
type GmpLimb# = Word#
type GmpSize = Int
type GmpSize# = Int#

-- | <i>Deprecated: Use bigNatCheck# instead</i>
isValidBigNat# :: BigNat -> Int#

-- | <i>Deprecated: Use bigNatSize# instead</i>
sizeofBigNat# :: BigNat -> GmpSize#

-- | <i>Deprecated: Use bigNatZero instead</i>
zeroBigNat :: BigNat

-- | <i>Deprecated: Use bigNatOne instead</i>
oneBigNat :: BigNat

-- | <i>Deprecated: Use bigNatFromWordArray instead</i>
byteArrayToBigNat# :: ByteArray# -> GmpSize# -> BigNat
wordToBigNat :: Word# -> BigNat
wordToBigNat2 :: Word# -> Word# -> BigNat
bigNatToInt :: BigNat -> Int#
bigNatToWord :: BigNat -> Word#

-- | <i>Deprecated: Use bigNatIndex# instead</i>
indexBigNat# :: BigNat -> GmpSize# -> GmpLimb#

-- | <i>Deprecated: Use bigNatAdd instead</i>
plusBigNat :: BigNat -> BigNat -> BigNat

-- | <i>Deprecated: Use bigNatAddWord# instead</i>
plusBigNatWord :: BigNat -> GmpLimb# -> BigNat

-- | <i>Deprecated: Use bigNatSub instead</i>
minusBigNat :: BigNat -> BigNat -> BigNat

-- | <i>Deprecated: Use bigNatSubWord# instead</i>
minusBigNatWord :: BigNat -> GmpLimb# -> BigNat

-- | <i>Deprecated: Use bigNatMul instead</i>
timesBigNat :: BigNat -> BigNat -> BigNat

-- | <i>Deprecated: Use bigNatMulWord# instead</i>
timesBigNatWord :: BigNat -> GmpLimb# -> BigNat

-- | <i>Deprecated: Use bigNatSqr instead</i>
sqrBigNat :: BigNat -> BigNat

-- | <i>Deprecated: Use bigNatQuotRem# instead</i>
quotRemBigNat :: BigNat -> BigNat -> (# BigNat, BigNat #)

-- | <i>Deprecated: Use bigNatQuotRemWord# instead</i>
quotRemBigNatWord :: BigNat -> GmpLimb# -> (# BigNat, GmpLimb# #)

-- | <i>Deprecated: Use bigNatQuotWord# instead</i>
quotBigNatWord :: BigNat -> GmpLimb# -> BigNat

-- | <i>Deprecated: Use bigNatQuot instead</i>
quotBigNat :: BigNat -> BigNat -> BigNat

-- | <i>Deprecated: Use bigNatRem instead</i>
remBigNat :: BigNat -> BigNat -> BigNat

-- | <i>Deprecated: Use bigNatRemWord# instead</i>
remBigNatWord :: BigNat -> GmpLimb# -> Word#

-- | <i>Deprecated: Use bigNatGcd instead</i>
gcdBigNat :: BigNat -> BigNat -> BigNat

-- | <i>Deprecated: Use bigNatGcdWord# instead</i>
gcdBigNatWord :: BigNat -> Word# -> Word#

-- | <i>Deprecated: Use bigNatShiftR# instead</i>
shiftRBigNat :: BigNat -> Int# -> BigNat

-- | <i>Deprecated: Use bigNatShiftL# instead</i>
shiftLBigNat :: BigNat -> Int# -> BigNat

-- | <i>Deprecated: Use bigNatTestBit# instead</i>
testBitBigNat :: BigNat -> Int# -> Bool

-- | <i>Deprecated: Use bigNatClearBit# instead</i>
clearBitBigNat :: BigNat -> Int# -> BigNat

-- | <i>Deprecated: Use bigNatComplementBit# instead</i>
complementBitBigNat :: BigNat -> Int# -> BigNat

-- | <i>Deprecated: Use bigNatSetBit# instead</i>
setBitBigNat :: BigNat -> Int# -> BigNat

-- | <i>Deprecated: Use bigNatAnd instead</i>
andBigNat :: BigNat -> BigNat -> BigNat

-- | <i>Deprecated: Use bigNatXor instead</i>
xorBigNat :: BigNat -> BigNat -> BigNat

-- | <i>Deprecated: Use bigNatPopCount# instead</i>
popCountBigNat :: BigNat -> Int#

-- | <i>Deprecated: Use bigNatOr instead</i>
orBigNat :: BigNat -> BigNat -> BigNat

-- | <i>Deprecated: Use bigNatBit# instead</i>
bitBigNat :: Int# -> BigNat

-- | <i>Deprecated: Use bigNatIsZero instead</i>
isZeroBigNat :: BigNat -> Bool

-- | <i>Deprecated: Use bigNatCompareWord# instead</i>
compareBigNatWord :: BigNat -> GmpLimb# -> Ordering

-- | <i>Deprecated: Use bigNatCompare instead</i>
compareBigNat :: BigNat -> BigNat -> Ordering

-- | <i>Deprecated: Use bigNatEqWord# instead</i>
eqBigNatWord :: BigNat -> GmpLimb# -> Bool

-- | <i>Deprecated: Use bigNatEqWord# instead</i>
eqBigNatWord# :: BigNat -> GmpLimb# -> Int#

-- | <i>Deprecated: Use bigNatEq instead</i>
eqBigNat :: BigNat -> BigNat -> Bool

-- | <i>Deprecated: Use bigNatEq# instead</i>
eqBigNat# :: BigNat -> BigNat -> Int#

-- | <i>Deprecated: Use bigNatGtWord# instead</i>
gtBigNatWord# :: BigNat -> GmpLimb# -> Int#

-- | <i>Deprecated: Use bigNatSizeInBase# instead</i>
sizeInBaseBigNat :: BigNat -> Int# -> Word#

-- | <i>Deprecated: Use integerSizeInBase# instead</i>
sizeInBaseInteger :: Integer -> Int# -> Word#

-- | <i>Deprecated: Use wordSizeInBase# instead</i>
sizeInBaseWord# :: Word# -> Int# -> Word#

-- | <i>Deprecated: Use bigNatToAddr# instead</i>
exportBigNatToAddr :: BigNat -> Addr# -> Int# -> IO Word

-- | <i>Deprecated: Use integerToAddr# instead</i>
exportIntegerToAddr :: Integer -> Addr# -> Int# -> IO Word

-- | <i>Deprecated: Use bigNatToMutableByteArray# instead</i>
exportBigNatToMutableByteArray :: BigNat -> MutableByteArray# RealWorld -> Word# -> Int# -> IO Word

-- | <i>Deprecated: Use integerToMutableByteArray# instead</i>
exportIntegerToMutableByteArray :: Integer -> MutableByteArray# RealWorld -> Word# -> Int# -> IO Word

-- | <i>Deprecated: Use bigNatFromAddr# instead</i>
importBigNatFromAddr :: Addr# -> Word# -> Int# -> IO BigNat

-- | <i>Deprecated: Use integerFromAddr# instead</i>
importIntegerFromAddr :: Addr# -> Word# -> Int# -> IO Integer

-- | <i>Deprecated: Use bigNatFromByteArray# instead</i>
importBigNatFromByteArray :: ByteArray# -> Word# -> Word# -> Int# -> BigNat

-- | <i>Deprecated: Use integerFromByteArray# instead</i>
importIntegerFromByteArray :: ByteArray# -> Word# -> Word# -> Int# -> Integer
