[Git][ghc/ghc][master] base: deprecate GHC internals in GHC.Num
by Marge Bot (@marge-bot) 20 Jan '26
by Marge Bot (@marge-bot) 20 Jan '26
20 Jan '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
75a9053d by Teo Camarasu at 2026-01-20T13:58:07-05:00
base: deprecate GHC internals in GHC.Num
Implements CLC proposal: https://github.com/haskell/core-libraries-committee/issues/360
- - - - -
2 changed files:
- libraries/base/changelog.md
- libraries/base/src/GHC/Num.hs
Changes:
=====================================
libraries/base/changelog.md
=====================================
@@ -16,6 +16,7 @@
* GHC.Num.{BigNat, Integer, Natural} are no longer exposed. Users should import them from `ghc-bignum` instead. ([CLC proposal #359](github.com/haskell/core-libraries-committee/issues/359))
* Remove extra laziness from `Data.Bifunctor.Bifunctor` instances for all tuples to have the same laziness as their `Data.Functor.Functor` counterparts (i.e. they became more strict than before) ([CLC proposal #339](https://github.com/haskell/core-libraries-committee/issues/339))
* Adjust the strictness of `Data.List.iterate'` to be more reasonable: every element of the output list is forced to WHNF when the `(:)` containing it is forced. ([CLC proposal #335)](https://github.com/haskell/core-libraries-committee/issues/335)
+ * GHC internals in `GHC.Num` have been deprecated and will be removed after one major release. ((CLC proposal #360)[https://github.com/haskell/core-libraries-committee/issues/360])
* Add `nubOrd` / `nubOrdBy` to `Data.List` and `Data.List.NonEmpty`. ([CLC proposal #336](https://github.com/haskell/core-libraries-committee/issues/336))
* Add `Semigroup` and `Monoid` instances for `Control.Monad.ST.Lazy`. ([CLC proposal #374](https://github.com/haskell/core-libraries-committee/issues/374))
* `GHC.Conc.throwSTM` and `GHC.Conc.Sync.throwSTM` now carry a `HasCallStack` constraint and attach a `Backtrace` annotation to the thrown exception. ([GHC #25365](https://gitlab.haskell.org/ghc/ghc/-/issues/25365))
=====================================
libraries/base/src/GHC/Num.hs
=====================================
@@ -1,5 +1,7 @@
{-# LANGUAGE MagicHash #-}
{-# OPTIONS_HADDOCK not-home #-}
+-- don't warn that some but not all of Integer and Natural are deprecated
+{-# OPTIONS_GHC -Wno-incomplete-export-warnings -Wno-duplicate-exports #-}
-- |
-- Module : GHC.Num
@@ -15,191 +17,370 @@
module GHC.Num
( Num(..)
+ , Integer
+ , Natural
, subtract
, quotRemInteger
- , integerFromNatural
- , integerToNaturalClamp
- , integerToNaturalThrow
- , integerToNatural
- , integerToWord#
- , integerToInt#
- , integerToWord64#
- , integerToInt64#
- , integerAdd
- , integerMul
- , integerSub
- , integerNegate
- , integerAbs
- , integerPopCount#
- , integerQuot
- , integerRem
- , integerDiv
- , integerMod
- , integerDivMod#
- , integerQuotRem#
- , integerEncodeFloat#
- , integerEncodeDouble#
- , integerGcd
- , integerLcm
- , integerAnd
- , integerOr
- , integerXor
- , integerComplement
- , integerBit#
- , integerTestBit#
- , integerShiftL#
- , integerShiftR#
- , integerFromWord#
- , integerFromWord64#
- , integerFromInt64#
- , Integer(..)
- , integerBit
- , integerCheck
- , integerCheck#
- , integerCompare
- , integerDecodeDouble#
- , integerDivMod
- , integerEncodeDouble
- , integerEq
- , integerEq#
- , integerFromAddr
- , integerFromAddr#
- , integerFromBigNat#
- , integerFromBigNatNeg#
- , integerFromBigNatSign#
- , integerFromByteArray
- , integerFromByteArray#
- , integerFromInt
- , integerFromInt#
+ , integerToWord
, integerFromWord
- , integerFromWordList
- , integerFromWordNeg#
- , integerFromWordSign#
- , integerGcde
- , integerGcde#
- , integerGe
- , integerGe#
- , integerGt
- , integerGt#
- , integerIsNegative
- , integerIsNegative#
- , integerIsOne
- , integerIsPowerOf2#
- , integerIsZero
- , integerLe
- , integerLe#
- , integerLog2
- , integerLog2#
- , integerLogBase
- , integerLogBase#
- , integerLogBaseWord
- , integerLogBaseWord#
- , integerLt
- , integerLt#
- , integerNe
- , integerNe#
- , integerOne
- , integerPowMod#
- , integerQuotRem
- , integerRecipMod#
- , integerShiftL
- , integerShiftR
- , integerSignum
- , integerSignum#
- , integerSizeInBase#
- , integerSqr
- , integerTestBit
- , integerToAddr
- , integerToAddr#
- , integerToBigNatClamp#
- , integerToBigNatSign#
, integerToInt
- , integerToMutableByteArray
- , integerToMutableByteArray#
- , integerToWord
- , integerZero
- , naturalToWord#
- , naturalPopCount#
- , naturalShiftR#
- , naturalShiftL#
- , naturalAdd
- , naturalSub
- , naturalSubThrow
- , naturalSubUnsafe
- , naturalMul
- , naturalQuotRem#
- , naturalQuot
- , naturalRem
- , naturalAnd
- , naturalAndNot
- , naturalOr
- , naturalXor
- , naturalTestBit#
- , naturalBit#
- , naturalGcd
- , naturalLcm
- , naturalLog2#
- , naturalLogBaseWord#
- , naturalLogBase#
- , naturalPowMod
- , naturalSizeInBase#
- , Natural(..)
- , naturalBit
- , naturalCheck
- , naturalCheck#
- , naturalClearBit
- , naturalClearBit#
- , naturalCompare
- , naturalComplementBit
- , naturalComplementBit#
- , naturalEncodeDouble#
- , naturalEncodeFloat#
- , naturalEq
- , naturalEq#
- , naturalFromAddr
- , naturalFromAddr#
- , naturalFromBigNat#
- , naturalFromByteArray#
- , naturalFromWord
- , naturalFromWord#
- , naturalFromWord2#
- , naturalFromWordList
- , naturalGe
- , naturalGe#
- , naturalGt
- , naturalGt#
- , naturalIsOne
- , naturalIsPowerOf2#
- , naturalIsZero
- , naturalLe
- , naturalLe#
- , naturalLog2
- , naturalLogBase
- , naturalLogBaseWord
- , naturalLt
- , naturalLt#
- , naturalNe
- , naturalNe#
- , naturalNegate
- , naturalOne
- , naturalPopCount
- , naturalQuotRem
- , naturalSetBit
- , naturalSetBit#
- , naturalShiftL
- , naturalShiftR
- , naturalSignum
- , naturalSqr
- , naturalTestBit
- , naturalToAddr
- , naturalToAddr#
- , naturalToBigNat#
- , naturalToMutableByteArray#
- , naturalToWord
- , naturalToWordClamp
- , naturalToWordClamp#
- , naturalToWordMaybe#
- , naturalZero
+ , integerFromInt
+ , integerToNatural
+ , integerFromNatural
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ Integer(IN, IP, IS)
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ Natural(NS, NB)
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerToNaturalClamp
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerToNaturalThrow
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerToWord#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerToInt#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerToWord64#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerToInt64#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerAdd
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerMul
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerSub
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerNegate
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerAbs
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerPopCount#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerQuot
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerRem
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerDiv
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerMod
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerDivMod#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerQuotRem#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerEncodeFloat#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerEncodeDouble#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerGcd
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerLcm
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerAnd
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerOr
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerXor
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerComplement
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerBit#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerTestBit#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerShiftL#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerShiftR#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerFromWord#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerFromWord64#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerFromInt64#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerBit
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerCheck
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerCheck#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerCompare
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerDecodeDouble#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerDivMod
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerEncodeDouble
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerEq
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerEq#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerFromAddr
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerFromAddr#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerFromBigNat#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerFromBigNatNeg#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerFromBigNatSign#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerFromByteArray
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerFromByteArray#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerFromInt#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerFromWordList
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerFromWordNeg#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerFromWordSign#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerGcde
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerGcde#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerGe
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerGe#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerGt
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerGt#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerIsNegative
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerIsNegative#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerIsOne
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerIsPowerOf2#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerIsZero
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerLe
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerLe#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerLog2
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerLog2#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerLogBase
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerLogBase#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerLogBaseWord
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerLogBaseWord#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerLt
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerLt#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerNe
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerNe#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerOne
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerPowMod#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerQuotRem
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerRecipMod#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerShiftL
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerShiftR
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerSignum
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerSignum#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerSizeInBase#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerSqr
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerTestBit
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerToAddr
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerToAddr#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerToBigNatClamp#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerToBigNatSign#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerToMutableByteArray
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerToMutableByteArray#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ integerZero
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalToWord#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalPopCount#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalShiftR#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalShiftL#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalAdd
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalSub
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalSubThrow
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalSubUnsafe
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalMul
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalQuotRem#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalQuot
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalRem
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalAnd
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalAndNot
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalOr
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalXor
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalTestBit#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalBit#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalGcd
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalLcm
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalLog2#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalLogBaseWord#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalLogBase#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalPowMod
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalSizeInBase#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalBit
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalCheck
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalCheck#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalClearBit
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalClearBit#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalCompare
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalComplementBit
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalComplementBit#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalEncodeDouble#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalEncodeFloat#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalEq
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalEq#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalFromAddr
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalFromAddr#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalFromBigNat#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalFromByteArray#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalFromWord
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalFromWord#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalFromWord2#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalFromWordList
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalGe
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalGe#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalGt
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalGt#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalIsOne
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalIsPowerOf2#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalIsZero
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalLe
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalLe#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalLog2
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalLogBase
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalLogBaseWord
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalLt
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalLt#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalNe
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalNe#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalNegate
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalOne
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalPopCount
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalQuotRem
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalSetBit
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalSetBit#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalShiftL
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalShiftR
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalSignum
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalSqr
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalTestBit
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalToAddr
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalToAddr#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalToBigNat#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalToMutableByteArray#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalToWord
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalToWordClamp
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalToWordClamp#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalToWordMaybe#
+ , {-# DEPRECATED ["The internals of big numbers will be removed in 4.24.", "Use ghc-bignum instead."] #-}
+ naturalZero
)
where
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/75a9053d26183e71b48de4c603b04af…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/75a9053d26183e71b48de4c603b04af…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][master] base: don't expose GHC.Num.{BigNat, Integer, Natural}
by Marge Bot (@marge-bot) 20 Jan '26
by Marge Bot (@marge-bot) 20 Jan '26
20 Jan '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
30f442a9 by Teo Camarasu at 2026-01-20T13:57:26-05:00
base: don't expose GHC.Num.{BigNat, Integer, Natural}
We no longer expose GHC.Num.{BigNat, Integer, Natural} from base instead users should get these modules from ghc-bignum.
We make this change to insulate end users from changes to GHC's implementation of big numbers.
Implements CLC proposal 359: https://github.com/haskell/core-libraries-committee/issues/359
- - - - -
13 changed files:
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- libraries/base/src/Data/Array/Byte.hs
- − libraries/base/src/GHC/Num/BigNat.hs
- − libraries/base/src/GHC/Num/Integer.hs
- − libraries/base/src/GHC/Num/Natural.hs
- libraries/base/src/System/CPUTime/Utils.hs
- libraries/ghc-bignum/ghc-bignum.cabal
- libraries/ghc-experimental/src/GHC/TypeNats/Experimental.hs
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
Changes:
=====================================
libraries/base/base.cabal.in
=====================================
@@ -219,9 +219,6 @@ Library
, GHC.MVar
, GHC.Natural
, GHC.Num
- , GHC.Num.Integer
- , GHC.Num.Natural
- , GHC.Num.BigNat
, GHC.OldList
, GHC.OverloadedLabels
, GHC.Profiling
=====================================
libraries/base/changelog.md
=====================================
@@ -13,6 +13,7 @@
* Add `thenA` and `thenM`. ([CLC proposal #351](https://github.com/haskell/core-libraries-committee/issues/351))
* Fix bug where `naturalAndNot` was incorrectly truncating results ([CLC proposal #350](github.com/haskell/core-libraries-committee/issues/350))
* generalize `deleteBy` and `deleteFirstsBy` ([CLC proposal 372](https://github.com/haskell/core-libraries-committee/issues/372))
+ * GHC.Num.{BigNat, Integer, Natural} are no longer exposed. Users should import them from `ghc-bignum` instead. ([CLC proposal #359](github.com/haskell/core-libraries-committee/issues/359))
* Remove extra laziness from `Data.Bifunctor.Bifunctor` instances for all tuples to have the same laziness as their `Data.Functor.Functor` counterparts (i.e. they became more strict than before) ([CLC proposal #339](https://github.com/haskell/core-libraries-committee/issues/339))
* Adjust the strictness of `Data.List.iterate'` to be more reasonable: every element of the output list is forced to WHNF when the `(:)` containing it is forced. ([CLC proposal #335)](https://github.com/haskell/core-libraries-committee/issues/335)
* Add `nubOrd` / `nubOrdBy` to `Data.List` and `Data.List.NonEmpty`. ([CLC proposal #336](https://github.com/haskell/core-libraries-committee/issues/336))
=====================================
libraries/base/src/Data/Array/Byte.hs
=====================================
@@ -27,7 +27,7 @@ import qualified GHC.Internal.Data.Foldable as F
import GHC.Internal.Data.Maybe (fromMaybe)
import Data.Semigroup
import GHC.Internal.Exts
-import GHC.Num.Integer (Integer(..))
+import GHC.Internal.Bignum.Integer (Integer(..))
import GHC.Internal.Show (intToDigit)
import GHC.Internal.ST (ST(..), runST)
import GHC.Internal.Word (Word8(..))
=====================================
libraries/base/src/GHC/Num/BigNat.hs deleted
=====================================
@@ -1,6 +0,0 @@
-module GHC.Num.BigNat
- ( module GHC.Internal.Bignum.BigNat
- )
-where
-
-import GHC.Internal.Bignum.BigNat
=====================================
libraries/base/src/GHC/Num/Integer.hs deleted
=====================================
@@ -1,6 +0,0 @@
-module GHC.Num.Integer
- ( module GHC.Internal.Bignum.Integer
- )
-where
-
-import GHC.Internal.Bignum.Integer
=====================================
libraries/base/src/GHC/Num/Natural.hs deleted
=====================================
@@ -1,6 +0,0 @@
-module GHC.Num.Natural
- ( module GHC.Internal.Bignum.Natural
- )
-where
-
-import GHC.Internal.Bignum.Natural
=====================================
libraries/base/src/System/CPUTime/Utils.hs
=====================================
@@ -8,7 +8,7 @@ module System.CPUTime.Utils
) where
import GHC.Internal.Foreign.C.Types
-import GHC.Num.Integer (Integer)
+import GHC.Internal.Bignum.Integer (Integer)
import GHC.Internal.Real (fromIntegral)
cClockToInteger :: CClock -> Integer
=====================================
libraries/ghc-bignum/ghc-bignum.cabal
=====================================
@@ -10,10 +10,8 @@ bug-reports: https://gitlab.haskell.org/ghc/ghc/issues/new
category: Numeric, Algebra, GHC
build-type: Simple
description:
- This package used to provide the low-level implementation of the standard
+ This package provides the low-level implementation of the standard
'BigNat', 'Natural' and 'Integer' types.
- Use `base:GHC.Num.{Integer,Natural,BigNat}` instead or other modules from
- `ghc-internal`.
extra-source-files:
changelog.md
@@ -40,13 +38,6 @@ library
, GHC.Internal.Bignum.Backend as GHC.Num.Backend
, GHC.Internal.Bignum.Backend.Selected as GHC.Num.Backend.Selected
, GHC.Internal.Bignum.Backend.Native as GHC.Num.Backend.Native
- -- reexport from base
- -- We can't reexport these modules from ghc-internal otherwise we get
- -- ambiguity between:
- -- ghc-bignum:GHC.Num.X
- -- base:GHC.Num.X
- -- we should probably just deprecate ghc-bignum and encourage users to use
- -- exports from base instead.
- , GHC.Num.BigNat
- , GHC.Num.Natural
- , GHC.Num.Integer
+ , GHC.Internal.Bignum.BigNat as GHC.Num.BigNat
+ , GHC.Internal.Bignum.Natural as GHC.Num.Natural
+ , GHC.Internal.Bignum.Integer as GHC.Num.Integer
=====================================
libraries/ghc-experimental/src/GHC/TypeNats/Experimental.hs
=====================================
@@ -12,7 +12,7 @@ module GHC.TypeNats.Experimental (
) where
import GHC.Internal.TypeNats
-import GHC.Num.Natural (naturalLog2)
+import GHC.Internal.Bignum.Natural (naturalLog2)
plusSNat :: SNat n -> SNat m -> SNat (n + m)
plusSNat (UnsafeSNat n) (UnsafeSNat m) = UnsafeSNat (n + m)
=====================================
testsuite/tests/interface-stability/base-exports.stdout
=====================================
@@ -8550,340 +8550,6 @@ module GHC.Num where
quotRemInteger :: Integer -> Integer -> (# Integer, Integer #)
subtract :: forall a. Num a => a -> a -> a
-module GHC.Num.BigNat where
- -- Safety: None
- type BigNat :: *
- data BigNat = BN# {unBigNat :: BigNat#}
- type BigNat# :: GHC.Internal.Types.UnliftedType
- type BigNat# = GHC.Internal.Bignum.WordArray.WordArray#
- bigNatAdd :: BigNat# -> BigNat# -> BigNat#
- bigNatAddWord :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatAddWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatAnd :: BigNat# -> BigNat# -> BigNat#
- bigNatAndInt# :: BigNat# -> GHC.Internal.Prim.Int# -> BigNat#
- bigNatAndNot :: BigNat# -> BigNat# -> BigNat#
- bigNatAndNotWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatAndWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatBit :: GHC.Internal.Types.Word -> BigNat#
- bigNatBit# :: GHC.Internal.Prim.Word# -> BigNat#
- bigNatCheck :: BigNat# -> GHC.Internal.Types.Bool
- bigNatCheck# :: BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatClearBit# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatCompare :: BigNat# -> BigNat# -> GHC.Internal.Types.Ordering
- bigNatCompareWord :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Ordering
- bigNatCompareWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Types.Ordering
- bigNatComplementBit# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatCtz :: BigNat# -> GHC.Internal.Types.Word
- bigNatCtz# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatCtzWord :: BigNat# -> GHC.Internal.Types.Word
- bigNatCtzWord# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatEncodeDouble# :: BigNat# -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Double#
- bigNatEq :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatEq# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatEqWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatFromAbsInt# :: GHC.Internal.Prim.Int# -> BigNat#
- bigNatFromAddr# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromAddrBE# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromAddrLE# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromByteArray# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromByteArrayBE# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromByteArrayLE# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromWord :: GHC.Internal.Types.Word -> BigNat#
- bigNatFromWord# :: GHC.Internal.Prim.Word# -> BigNat#
- bigNatFromWord2# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatFromWord64# :: GHC.Internal.Prim.Word64# -> BigNat#
- bigNatFromWordArray :: GHC.Internal.Bignum.WordArray.WordArray# -> GHC.Internal.Prim.Word# -> BigNat
- bigNatFromWordArray# :: GHC.Internal.Bignum.WordArray.WordArray# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatFromWordList :: [GHC.Internal.Types.Word] -> BigNat#
- bigNatFromWordList# :: [GHC.Internal.Types.Word] -> GHC.Internal.Bignum.WordArray.WordArray#
- bigNatFromWordListUnsafe :: [GHC.Internal.Types.Word] -> BigNat#
- bigNatGcd :: BigNat# -> BigNat# -> BigNat#
- bigNatGcdWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- bigNatGe :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatGe# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatGt :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatGt# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatGtWord :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- bigNatGtWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatIndex :: BigNat# -> GHC.Internal.Prim.Int# -> GHC.Internal.Types.Word
- bigNatIndex# :: BigNat# -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Word#
- bigNatIsOne :: BigNat# -> GHC.Internal.Types.Bool
- bigNatIsOne# :: BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatIsPowerOf2# :: BigNat# -> (# (# #) | GHC.Internal.Prim.Word# #)
- bigNatIsTwo :: BigNat# -> GHC.Internal.Types.Bool
- bigNatIsTwo# :: BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatIsZero :: BigNat# -> GHC.Internal.Types.Bool
- bigNatIsZero# :: BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatLcm :: BigNat# -> BigNat# -> BigNat#
- bigNatLcmWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatLcmWordWord# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatLe :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatLe# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatLeWord :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- bigNatLeWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatLog2 :: BigNat# -> GHC.Internal.Types.Word
- bigNatLog2# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatLogBase :: BigNat# -> BigNat# -> GHC.Internal.Types.Word
- bigNatLogBase# :: BigNat# -> BigNat# -> GHC.Internal.Prim.Word#
- bigNatLogBaseWord :: GHC.Internal.Types.Word -> BigNat# -> GHC.Internal.Types.Word
- bigNatLogBaseWord# :: GHC.Internal.Prim.Word# -> BigNat# -> GHC.Internal.Prim.Word#
- bigNatLt :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatLt# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatMul :: BigNat# -> BigNat# -> BigNat#
- bigNatMulWord :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatMulWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatNe :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatNe# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatOne :: BigNat
- bigNatOne# :: (# #) -> BigNat#
- bigNatOr :: BigNat# -> BigNat# -> BigNat#
- bigNatOrWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatPopCount :: BigNat# -> GHC.Internal.Types.Word
- bigNatPopCount# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatPowMod :: BigNat# -> BigNat# -> BigNat# -> BigNat#
- bigNatPowModWord# :: BigNat# -> BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- bigNatQuot :: BigNat# -> BigNat# -> BigNat#
- bigNatQuotRem# :: BigNat# -> BigNat# -> (# BigNat#, BigNat# #)
- bigNatQuotRemWord# :: BigNat# -> GHC.Internal.Prim.Word# -> (# BigNat#, GHC.Internal.Prim.Word# #)
- bigNatQuotWord :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatQuotWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatRem :: BigNat# -> BigNat# -> BigNat#
- bigNatRemWord :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Word
- bigNatRemWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- bigNatSetBit# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatShiftL :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatShiftL# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatShiftR :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatShiftR# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatShiftRNeg# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatSize :: BigNat# -> GHC.Internal.Types.Word
- bigNatSize# :: BigNat# -> GHC.Internal.Prim.Int#
- bigNatSizeInBase :: GHC.Internal.Types.Word -> BigNat# -> GHC.Internal.Types.Word
- bigNatSizeInBase# :: GHC.Internal.Prim.Word# -> BigNat# -> GHC.Internal.Prim.Word#
- bigNatSqr :: BigNat# -> BigNat#
- bigNatSub :: BigNat# -> BigNat# -> (# (# #) | BigNat# #)
- bigNatSubUnsafe :: BigNat# -> BigNat# -> BigNat#
- bigNatSubWord# :: BigNat# -> GHC.Internal.Prim.Word# -> (# (# #) | BigNat# #)
- bigNatSubWordUnsafe :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatSubWordUnsafe# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatTestBit :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- bigNatTestBit# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatToAddr :: BigNat# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO GHC.Internal.Types.Word
- bigNatToAddr# :: forall s. BigNat# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToAddrBE# :: forall s. BigNat# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToAddrLE# :: forall s. BigNat# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToInt :: BigNat# -> GHC.Internal.Types.Int
- bigNatToInt# :: BigNat# -> GHC.Internal.Prim.Int#
- bigNatToMutableByteArray# :: forall s. BigNat# -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToMutableByteArrayBE# :: forall s. BigNat# -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToMutableByteArrayLE# :: forall s. BigNat# -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToWord :: BigNat# -> GHC.Internal.Types.Word
- bigNatToWord# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatToWord64# :: BigNat# -> GHC.Internal.Prim.Word64#
- bigNatToWordList :: BigNat# -> [GHC.Internal.Types.Word]
- bigNatToWordMaybe# :: BigNat# -> (# (# #) | GHC.Internal.Prim.Word# #)
- bigNatXor :: BigNat# -> BigNat# -> BigNat#
- bigNatXorWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatZero :: BigNat
- bigNatZero# :: (# #) -> BigNat#
- gcdInt :: GHC.Internal.Types.Int -> GHC.Internal.Types.Int -> GHC.Internal.Types.Int
- gcdInt# :: GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Int#
- gcdWord :: GHC.Internal.Types.Word -> GHC.Internal.Types.Word -> GHC.Internal.Types.Word
- gcdWord# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- powModWord# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- raiseDivZero_BigNat :: (# #) -> BigNat#
-
-module GHC.Num.Integer where
- -- Safety: None
- type Integer :: *
- data Integer = IS GHC.Internal.Prim.Int# | IP GHC.Internal.Prim.ByteArray# | IN GHC.Internal.Prim.ByteArray#
- integerAbs :: Integer -> Integer
- integerAdd :: Integer -> Integer -> Integer
- integerAnd :: Integer -> Integer -> Integer
- integerBit :: GHC.Internal.Types.Word -> Integer
- integerBit# :: GHC.Internal.Prim.Word# -> Integer
- integerCheck :: Integer -> GHC.Internal.Types.Bool
- integerCheck# :: Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerCompare :: Integer -> Integer -> GHC.Internal.Types.Ordering
- integerComplement :: Integer -> Integer
- integerDecodeDouble# :: GHC.Internal.Prim.Double# -> (# Integer, GHC.Internal.Prim.Int# #)
- integerDiv :: Integer -> Integer -> Integer
- integerDivMod :: Integer -> Integer -> (Integer, Integer)
- integerDivMod# :: Integer -> Integer -> (# Integer, Integer #)
- integerEncodeDouble :: Integer -> GHC.Internal.Types.Int -> GHC.Internal.Types.Double
- integerEncodeDouble# :: Integer -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Double#
- integerEncodeFloat# :: Integer -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Float#
- integerEq :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerEq# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerFromAddr :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO Integer
- integerFromAddr# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, Integer #)
- integerFromBigNat# :: GHC.Internal.Bignum.BigNat.BigNat# -> Integer
- integerFromBigNatNeg# :: GHC.Internal.Bignum.BigNat.BigNat# -> Integer
- integerFromBigNatSign# :: GHC.Internal.Prim.Int# -> GHC.Internal.Bignum.BigNat.BigNat# -> Integer
- integerFromByteArray :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> Integer
- integerFromByteArray# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, Integer #)
- integerFromInt :: GHC.Internal.Types.Int -> Integer
- integerFromInt# :: GHC.Internal.Prim.Int# -> Integer
- integerFromInt64# :: GHC.Internal.Prim.Int64# -> Integer
- integerFromNatural :: GHC.Internal.Bignum.Natural.Natural -> Integer
- integerFromWord :: GHC.Internal.Types.Word -> Integer
- integerFromWord# :: GHC.Internal.Prim.Word# -> Integer
- integerFromWord64# :: GHC.Internal.Prim.Word64# -> Integer
- integerFromWordList :: GHC.Internal.Types.Bool -> [GHC.Internal.Types.Word] -> Integer
- integerFromWordNeg# :: GHC.Internal.Prim.Word# -> Integer
- integerFromWordSign# :: GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Word# -> Integer
- integerGcd :: Integer -> Integer -> Integer
- integerGcde :: Integer -> Integer -> (Integer, Integer, Integer)
- integerGcde# :: Integer -> Integer -> (# Integer, Integer, Integer #)
- integerGe :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerGe# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerGt :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerGt# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerIsNegative :: Integer -> GHC.Internal.Types.Bool
- integerIsNegative# :: Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerIsOne :: Integer -> GHC.Internal.Types.Bool
- integerIsPowerOf2# :: Integer -> (# (# #) | GHC.Internal.Prim.Word# #)
- integerIsZero :: Integer -> GHC.Internal.Types.Bool
- integerLcm :: Integer -> Integer -> Integer
- integerLe :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerLe# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerLog2 :: Integer -> GHC.Internal.Types.Word
- integerLog2# :: Integer -> GHC.Internal.Prim.Word#
- integerLogBase :: Integer -> Integer -> GHC.Internal.Types.Word
- integerLogBase# :: Integer -> Integer -> GHC.Internal.Prim.Word#
- integerLogBaseWord :: GHC.Internal.Types.Word -> Integer -> GHC.Internal.Types.Word
- integerLogBaseWord# :: GHC.Internal.Prim.Word# -> Integer -> GHC.Internal.Prim.Word#
- integerLt :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerLt# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerMod :: Integer -> Integer -> Integer
- integerMul :: Integer -> Integer -> Integer
- integerNe :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerNe# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerNegate :: Integer -> Integer
- integerOne :: Integer
- integerOr :: Integer -> Integer -> Integer
- integerPopCount# :: Integer -> GHC.Internal.Prim.Int#
- integerPowMod# :: Integer -> Integer -> GHC.Internal.Bignum.Natural.Natural -> (# GHC.Internal.Bignum.Natural.Natural | () #)
- integerQuot :: Integer -> Integer -> Integer
- integerQuotRem :: Integer -> Integer -> (Integer, Integer)
- integerQuotRem# :: Integer -> Integer -> (# Integer, Integer #)
- integerRecipMod# :: Integer -> GHC.Internal.Bignum.Natural.Natural -> (# GHC.Internal.Bignum.Natural.Natural | () #)
- integerRem :: Integer -> Integer -> Integer
- integerShiftL :: Integer -> GHC.Internal.Types.Word -> Integer
- integerShiftL# :: Integer -> GHC.Internal.Prim.Word# -> Integer
- integerShiftR :: Integer -> GHC.Internal.Types.Word -> Integer
- integerShiftR# :: Integer -> GHC.Internal.Prim.Word# -> Integer
- integerSignum :: Integer -> Integer
- integerSignum# :: Integer -> GHC.Internal.Prim.Int#
- integerSizeInBase# :: GHC.Internal.Prim.Word# -> Integer -> GHC.Internal.Prim.Word#
- integerSqr :: Integer -> Integer
- integerSub :: Integer -> Integer -> Integer
- integerTestBit :: Integer -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- integerTestBit# :: Integer -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- integerToAddr :: Integer -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO GHC.Internal.Types.Word
- integerToAddr# :: forall s. Integer -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- integerToBigNatClamp# :: Integer -> GHC.Internal.Bignum.BigNat.BigNat#
- integerToBigNatSign# :: Integer -> (# GHC.Internal.Prim.Int#, GHC.Internal.Bignum.BigNat.BigNat# #)
- integerToInt :: Integer -> GHC.Internal.Types.Int
- integerToInt# :: Integer -> GHC.Internal.Prim.Int#
- integerToInt64# :: Integer -> GHC.Internal.Prim.Int64#
- integerToMutableByteArray :: Integer -> GHC.Internal.Prim.MutableByteArray# GHC.Internal.Prim.RealWorld -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO GHC.Internal.Types.Word
- integerToMutableByteArray# :: forall s. Integer -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- integerToNatural :: Integer -> GHC.Internal.Bignum.Natural.Natural
- integerToNaturalClamp :: Integer -> GHC.Internal.Bignum.Natural.Natural
- integerToNaturalThrow :: Integer -> GHC.Internal.Bignum.Natural.Natural
- integerToWord :: Integer -> GHC.Internal.Types.Word
- integerToWord# :: Integer -> GHC.Internal.Prim.Word#
- integerToWord64# :: Integer -> GHC.Internal.Prim.Word64#
- integerXor :: Integer -> Integer -> Integer
- integerZero :: Integer
-
-module GHC.Num.Natural where
- -- Safety: None
- type Natural :: *
- data Natural = NS GHC.Internal.Prim.Word# | NB GHC.Internal.Prim.ByteArray#
- naturalAdd :: Natural -> Natural -> Natural
- naturalAnd :: Natural -> Natural -> Natural
- naturalAndNot :: Natural -> Natural -> Natural
- naturalBit :: GHC.Internal.Types.Word -> Natural
- naturalBit# :: GHC.Internal.Prim.Word# -> Natural
- naturalCheck :: Natural -> GHC.Internal.Types.Bool
- naturalCheck# :: Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalClearBit :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalClearBit# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalCompare :: Natural -> Natural -> GHC.Internal.Types.Ordering
- naturalComplementBit :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalComplementBit# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalEncodeDouble# :: Natural -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Double#
- naturalEncodeFloat# :: Natural -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Float#
- naturalEq :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalEq# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalFromAddr :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO Natural
- naturalFromAddr# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, Natural #)
- naturalFromBigNat# :: GHC.Internal.Bignum.BigNat.BigNat# -> Natural
- naturalFromByteArray# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, Natural #)
- naturalFromWord :: GHC.Internal.Types.Word -> Natural
- naturalFromWord# :: GHC.Internal.Prim.Word# -> Natural
- naturalFromWord2# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> Natural
- naturalFromWordList :: [GHC.Internal.Types.Word] -> Natural
- naturalGcd :: Natural -> Natural -> Natural
- naturalGe :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalGe# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalGt :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalGt# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalIsOne :: Natural -> GHC.Internal.Types.Bool
- naturalIsPowerOf2# :: Natural -> (# (# #) | GHC.Internal.Prim.Word# #)
- naturalIsZero :: Natural -> GHC.Internal.Types.Bool
- naturalLcm :: Natural -> Natural -> Natural
- naturalLe :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalLe# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalLog2 :: Natural -> GHC.Internal.Types.Word
- naturalLog2# :: Natural -> GHC.Internal.Prim.Word#
- naturalLogBase :: Natural -> Natural -> GHC.Internal.Types.Word
- naturalLogBase# :: Natural -> Natural -> GHC.Internal.Prim.Word#
- naturalLogBaseWord :: GHC.Internal.Types.Word -> Natural -> GHC.Internal.Types.Word
- naturalLogBaseWord# :: GHC.Internal.Prim.Word# -> Natural -> GHC.Internal.Prim.Word#
- naturalLt :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalLt# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalMul :: Natural -> Natural -> Natural
- naturalNe :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalNe# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalNegate :: Natural -> Natural
- naturalOne :: Natural
- naturalOr :: Natural -> Natural -> Natural
- naturalPopCount :: Natural -> GHC.Internal.Types.Word
- naturalPopCount# :: Natural -> GHC.Internal.Prim.Word#
- naturalPowMod :: Natural -> Natural -> Natural -> Natural
- naturalQuot :: Natural -> Natural -> Natural
- naturalQuotRem :: Natural -> Natural -> (Natural, Natural)
- naturalQuotRem# :: Natural -> Natural -> (# Natural, Natural #)
- naturalRem :: Natural -> Natural -> Natural
- naturalSetBit :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalSetBit# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalShiftL :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalShiftL# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalShiftR :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalShiftR# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalSignum :: Natural -> Natural
- naturalSizeInBase# :: GHC.Internal.Prim.Word# -> Natural -> GHC.Internal.Prim.Word#
- naturalSqr :: Natural -> Natural
- naturalSub :: Natural -> Natural -> (# (# #) | Natural #)
- naturalSubThrow :: Natural -> Natural -> Natural
- naturalSubUnsafe :: Natural -> Natural -> Natural
- naturalTestBit :: Natural -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- naturalTestBit# :: Natural -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- naturalToAddr :: Natural -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO GHC.Internal.Types.Word
- naturalToAddr# :: forall s. Natural -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- naturalToBigNat# :: Natural -> GHC.Internal.Bignum.BigNat.BigNat#
- naturalToMutableByteArray# :: forall s. Natural -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- naturalToWord :: Natural -> GHC.Internal.Types.Word
- naturalToWord# :: Natural -> GHC.Internal.Prim.Word#
- naturalToWordClamp :: Natural -> GHC.Internal.Types.Word
- naturalToWordClamp# :: Natural -> GHC.Internal.Prim.Word#
- naturalToWordMaybe# :: Natural -> (# (# #) | GHC.Internal.Prim.Word# #)
- naturalXor :: Natural -> Natural -> Natural
- naturalZero :: Natural
-
module GHC.OldList where
-- Safety: Safe
(!!) :: forall a. GHC.Internal.Stack.Types.HasCallStack => [a] -> GHC.Internal.Types.Int -> a
=====================================
testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
=====================================
@@ -8588,340 +8588,6 @@ module GHC.Num where
quotRemInteger :: Integer -> Integer -> (# Integer, Integer #)
subtract :: forall a. Num a => a -> a -> a
-module GHC.Num.BigNat where
- -- Safety: None
- type BigNat :: *
- data BigNat = BN# {unBigNat :: BigNat#}
- type BigNat# :: GHC.Internal.Types.UnliftedType
- type BigNat# = GHC.Internal.Bignum.WordArray.WordArray#
- bigNatAdd :: BigNat# -> BigNat# -> BigNat#
- bigNatAddWord :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatAddWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatAnd :: BigNat# -> BigNat# -> BigNat#
- bigNatAndInt# :: BigNat# -> GHC.Internal.Prim.Int# -> BigNat#
- bigNatAndNot :: BigNat# -> BigNat# -> BigNat#
- bigNatAndNotWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatAndWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatBit :: GHC.Internal.Types.Word -> BigNat#
- bigNatBit# :: GHC.Internal.Prim.Word# -> BigNat#
- bigNatCheck :: BigNat# -> GHC.Internal.Types.Bool
- bigNatCheck# :: BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatClearBit# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatCompare :: BigNat# -> BigNat# -> GHC.Internal.Types.Ordering
- bigNatCompareWord :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Ordering
- bigNatCompareWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Types.Ordering
- bigNatComplementBit# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatCtz :: BigNat# -> GHC.Internal.Types.Word
- bigNatCtz# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatCtzWord :: BigNat# -> GHC.Internal.Types.Word
- bigNatCtzWord# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatEncodeDouble# :: BigNat# -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Double#
- bigNatEq :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatEq# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatEqWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatFromAbsInt# :: GHC.Internal.Prim.Int# -> BigNat#
- bigNatFromAddr# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromAddrBE# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromAddrLE# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromByteArray# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromByteArrayBE# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromByteArrayLE# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromWord :: GHC.Internal.Types.Word -> BigNat#
- bigNatFromWord# :: GHC.Internal.Prim.Word# -> BigNat#
- bigNatFromWord2# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatFromWord64# :: GHC.Internal.Prim.Word64# -> BigNat#
- bigNatFromWordArray :: GHC.Internal.Bignum.WordArray.WordArray# -> GHC.Internal.Prim.Word# -> BigNat
- bigNatFromWordArray# :: GHC.Internal.Bignum.WordArray.WordArray# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatFromWordList :: [GHC.Internal.Types.Word] -> BigNat#
- bigNatFromWordList# :: [GHC.Internal.Types.Word] -> GHC.Internal.Bignum.WordArray.WordArray#
- bigNatFromWordListUnsafe :: [GHC.Internal.Types.Word] -> BigNat#
- bigNatGcd :: BigNat# -> BigNat# -> BigNat#
- bigNatGcdWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- bigNatGe :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatGe# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatGt :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatGt# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatGtWord :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- bigNatGtWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatIndex :: BigNat# -> GHC.Internal.Prim.Int# -> GHC.Internal.Types.Word
- bigNatIndex# :: BigNat# -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Word#
- bigNatIsOne :: BigNat# -> GHC.Internal.Types.Bool
- bigNatIsOne# :: BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatIsPowerOf2# :: BigNat# -> (# (# #) | GHC.Internal.Prim.Word# #)
- bigNatIsTwo :: BigNat# -> GHC.Internal.Types.Bool
- bigNatIsTwo# :: BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatIsZero :: BigNat# -> GHC.Internal.Types.Bool
- bigNatIsZero# :: BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatLcm :: BigNat# -> BigNat# -> BigNat#
- bigNatLcmWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatLcmWordWord# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatLe :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatLe# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatLeWord :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- bigNatLeWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatLog2 :: BigNat# -> GHC.Internal.Types.Word
- bigNatLog2# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatLogBase :: BigNat# -> BigNat# -> GHC.Internal.Types.Word
- bigNatLogBase# :: BigNat# -> BigNat# -> GHC.Internal.Prim.Word#
- bigNatLogBaseWord :: GHC.Internal.Types.Word -> BigNat# -> GHC.Internal.Types.Word
- bigNatLogBaseWord# :: GHC.Internal.Prim.Word# -> BigNat# -> GHC.Internal.Prim.Word#
- bigNatLt :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatLt# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatMul :: BigNat# -> BigNat# -> BigNat#
- bigNatMulWord :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatMulWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatNe :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatNe# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatOne :: BigNat
- bigNatOne# :: (# #) -> BigNat#
- bigNatOr :: BigNat# -> BigNat# -> BigNat#
- bigNatOrWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatPopCount :: BigNat# -> GHC.Internal.Types.Word
- bigNatPopCount# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatPowMod :: BigNat# -> BigNat# -> BigNat# -> BigNat#
- bigNatPowModWord# :: BigNat# -> BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- bigNatQuot :: BigNat# -> BigNat# -> BigNat#
- bigNatQuotRem# :: BigNat# -> BigNat# -> (# BigNat#, BigNat# #)
- bigNatQuotRemWord# :: BigNat# -> GHC.Internal.Prim.Word# -> (# BigNat#, GHC.Internal.Prim.Word# #)
- bigNatQuotWord :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatQuotWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatRem :: BigNat# -> BigNat# -> BigNat#
- bigNatRemWord :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Word
- bigNatRemWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- bigNatSetBit# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatShiftL :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatShiftL# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatShiftR :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatShiftR# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatShiftRNeg# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatSize :: BigNat# -> GHC.Internal.Types.Word
- bigNatSize# :: BigNat# -> GHC.Internal.Prim.Int#
- bigNatSizeInBase :: GHC.Internal.Types.Word -> BigNat# -> GHC.Internal.Types.Word
- bigNatSizeInBase# :: GHC.Internal.Prim.Word# -> BigNat# -> GHC.Internal.Prim.Word#
- bigNatSqr :: BigNat# -> BigNat#
- bigNatSub :: BigNat# -> BigNat# -> (# (# #) | BigNat# #)
- bigNatSubUnsafe :: BigNat# -> BigNat# -> BigNat#
- bigNatSubWord# :: BigNat# -> GHC.Internal.Prim.Word# -> (# (# #) | BigNat# #)
- bigNatSubWordUnsafe :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatSubWordUnsafe# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatTestBit :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- bigNatTestBit# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatToAddr :: BigNat# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO GHC.Internal.Types.Word
- bigNatToAddr# :: forall s. BigNat# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToAddrBE# :: forall s. BigNat# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToAddrLE# :: forall s. BigNat# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToInt :: BigNat# -> GHC.Internal.Types.Int
- bigNatToInt# :: BigNat# -> GHC.Internal.Prim.Int#
- bigNatToMutableByteArray# :: forall s. BigNat# -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToMutableByteArrayBE# :: forall s. BigNat# -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToMutableByteArrayLE# :: forall s. BigNat# -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToWord :: BigNat# -> GHC.Internal.Types.Word
- bigNatToWord# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatToWord64# :: BigNat# -> GHC.Internal.Prim.Word64#
- bigNatToWordList :: BigNat# -> [GHC.Internal.Types.Word]
- bigNatToWordMaybe# :: BigNat# -> (# (# #) | GHC.Internal.Prim.Word# #)
- bigNatXor :: BigNat# -> BigNat# -> BigNat#
- bigNatXorWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatZero :: BigNat
- bigNatZero# :: (# #) -> BigNat#
- gcdInt :: GHC.Internal.Types.Int -> GHC.Internal.Types.Int -> GHC.Internal.Types.Int
- gcdInt# :: GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Int#
- gcdWord :: GHC.Internal.Types.Word -> GHC.Internal.Types.Word -> GHC.Internal.Types.Word
- gcdWord# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- powModWord# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- raiseDivZero_BigNat :: (# #) -> BigNat#
-
-module GHC.Num.Integer where
- -- Safety: None
- type Integer :: *
- data Integer = IS GHC.Internal.Prim.Int# | IP GHC.Internal.Prim.ByteArray# | IN GHC.Internal.Prim.ByteArray#
- integerAbs :: Integer -> Integer
- integerAdd :: Integer -> Integer -> Integer
- integerAnd :: Integer -> Integer -> Integer
- integerBit :: GHC.Internal.Types.Word -> Integer
- integerBit# :: GHC.Internal.Prim.Word# -> Integer
- integerCheck :: Integer -> GHC.Internal.Types.Bool
- integerCheck# :: Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerCompare :: Integer -> Integer -> GHC.Internal.Types.Ordering
- integerComplement :: Integer -> Integer
- integerDecodeDouble# :: GHC.Internal.Prim.Double# -> (# Integer, GHC.Internal.Prim.Int# #)
- integerDiv :: Integer -> Integer -> Integer
- integerDivMod :: Integer -> Integer -> (Integer, Integer)
- integerDivMod# :: Integer -> Integer -> (# Integer, Integer #)
- integerEncodeDouble :: Integer -> GHC.Internal.Types.Int -> GHC.Internal.Types.Double
- integerEncodeDouble# :: Integer -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Double#
- integerEncodeFloat# :: Integer -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Float#
- integerEq :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerEq# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerFromAddr :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO Integer
- integerFromAddr# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, Integer #)
- integerFromBigNat# :: GHC.Internal.Bignum.BigNat.BigNat# -> Integer
- integerFromBigNatNeg# :: GHC.Internal.Bignum.BigNat.BigNat# -> Integer
- integerFromBigNatSign# :: GHC.Internal.Prim.Int# -> GHC.Internal.Bignum.BigNat.BigNat# -> Integer
- integerFromByteArray :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> Integer
- integerFromByteArray# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, Integer #)
- integerFromInt :: GHC.Internal.Types.Int -> Integer
- integerFromInt# :: GHC.Internal.Prim.Int# -> Integer
- integerFromInt64# :: GHC.Internal.Prim.Int64# -> Integer
- integerFromNatural :: GHC.Internal.Bignum.Natural.Natural -> Integer
- integerFromWord :: GHC.Internal.Types.Word -> Integer
- integerFromWord# :: GHC.Internal.Prim.Word# -> Integer
- integerFromWord64# :: GHC.Internal.Prim.Word64# -> Integer
- integerFromWordList :: GHC.Internal.Types.Bool -> [GHC.Internal.Types.Word] -> Integer
- integerFromWordNeg# :: GHC.Internal.Prim.Word# -> Integer
- integerFromWordSign# :: GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Word# -> Integer
- integerGcd :: Integer -> Integer -> Integer
- integerGcde :: Integer -> Integer -> (Integer, Integer, Integer)
- integerGcde# :: Integer -> Integer -> (# Integer, Integer, Integer #)
- integerGe :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerGe# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerGt :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerGt# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerIsNegative :: Integer -> GHC.Internal.Types.Bool
- integerIsNegative# :: Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerIsOne :: Integer -> GHC.Internal.Types.Bool
- integerIsPowerOf2# :: Integer -> (# (# #) | GHC.Internal.Prim.Word# #)
- integerIsZero :: Integer -> GHC.Internal.Types.Bool
- integerLcm :: Integer -> Integer -> Integer
- integerLe :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerLe# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerLog2 :: Integer -> GHC.Internal.Types.Word
- integerLog2# :: Integer -> GHC.Internal.Prim.Word#
- integerLogBase :: Integer -> Integer -> GHC.Internal.Types.Word
- integerLogBase# :: Integer -> Integer -> GHC.Internal.Prim.Word#
- integerLogBaseWord :: GHC.Internal.Types.Word -> Integer -> GHC.Internal.Types.Word
- integerLogBaseWord# :: GHC.Internal.Prim.Word# -> Integer -> GHC.Internal.Prim.Word#
- integerLt :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerLt# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerMod :: Integer -> Integer -> Integer
- integerMul :: Integer -> Integer -> Integer
- integerNe :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerNe# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerNegate :: Integer -> Integer
- integerOne :: Integer
- integerOr :: Integer -> Integer -> Integer
- integerPopCount# :: Integer -> GHC.Internal.Prim.Int#
- integerPowMod# :: Integer -> Integer -> GHC.Internal.Bignum.Natural.Natural -> (# GHC.Internal.Bignum.Natural.Natural | () #)
- integerQuot :: Integer -> Integer -> Integer
- integerQuotRem :: Integer -> Integer -> (Integer, Integer)
- integerQuotRem# :: Integer -> Integer -> (# Integer, Integer #)
- integerRecipMod# :: Integer -> GHC.Internal.Bignum.Natural.Natural -> (# GHC.Internal.Bignum.Natural.Natural | () #)
- integerRem :: Integer -> Integer -> Integer
- integerShiftL :: Integer -> GHC.Internal.Types.Word -> Integer
- integerShiftL# :: Integer -> GHC.Internal.Prim.Word# -> Integer
- integerShiftR :: Integer -> GHC.Internal.Types.Word -> Integer
- integerShiftR# :: Integer -> GHC.Internal.Prim.Word# -> Integer
- integerSignum :: Integer -> Integer
- integerSignum# :: Integer -> GHC.Internal.Prim.Int#
- integerSizeInBase# :: GHC.Internal.Prim.Word# -> Integer -> GHC.Internal.Prim.Word#
- integerSqr :: Integer -> Integer
- integerSub :: Integer -> Integer -> Integer
- integerTestBit :: Integer -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- integerTestBit# :: Integer -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- integerToAddr :: Integer -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO GHC.Internal.Types.Word
- integerToAddr# :: forall s. Integer -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- integerToBigNatClamp# :: Integer -> GHC.Internal.Bignum.BigNat.BigNat#
- integerToBigNatSign# :: Integer -> (# GHC.Internal.Prim.Int#, GHC.Internal.Bignum.BigNat.BigNat# #)
- integerToInt :: Integer -> GHC.Internal.Types.Int
- integerToInt# :: Integer -> GHC.Internal.Prim.Int#
- integerToInt64# :: Integer -> GHC.Internal.Prim.Int64#
- integerToMutableByteArray :: Integer -> GHC.Internal.Prim.MutableByteArray# GHC.Internal.Prim.RealWorld -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO GHC.Internal.Types.Word
- integerToMutableByteArray# :: forall s. Integer -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- integerToNatural :: Integer -> GHC.Internal.Bignum.Natural.Natural
- integerToNaturalClamp :: Integer -> GHC.Internal.Bignum.Natural.Natural
- integerToNaturalThrow :: Integer -> GHC.Internal.Bignum.Natural.Natural
- integerToWord :: Integer -> GHC.Internal.Types.Word
- integerToWord# :: Integer -> GHC.Internal.Prim.Word#
- integerToWord64# :: Integer -> GHC.Internal.Prim.Word64#
- integerXor :: Integer -> Integer -> Integer
- integerZero :: Integer
-
-module GHC.Num.Natural where
- -- Safety: None
- type Natural :: *
- data Natural = NS GHC.Internal.Prim.Word# | NB GHC.Internal.Prim.ByteArray#
- naturalAdd :: Natural -> Natural -> Natural
- naturalAnd :: Natural -> Natural -> Natural
- naturalAndNot :: Natural -> Natural -> Natural
- naturalBit :: GHC.Internal.Types.Word -> Natural
- naturalBit# :: GHC.Internal.Prim.Word# -> Natural
- naturalCheck :: Natural -> GHC.Internal.Types.Bool
- naturalCheck# :: Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalClearBit :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalClearBit# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalCompare :: Natural -> Natural -> GHC.Internal.Types.Ordering
- naturalComplementBit :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalComplementBit# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalEncodeDouble# :: Natural -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Double#
- naturalEncodeFloat# :: Natural -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Float#
- naturalEq :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalEq# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalFromAddr :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO Natural
- naturalFromAddr# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, Natural #)
- naturalFromBigNat# :: GHC.Internal.Bignum.BigNat.BigNat# -> Natural
- naturalFromByteArray# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, Natural #)
- naturalFromWord :: GHC.Internal.Types.Word -> Natural
- naturalFromWord# :: GHC.Internal.Prim.Word# -> Natural
- naturalFromWord2# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> Natural
- naturalFromWordList :: [GHC.Internal.Types.Word] -> Natural
- naturalGcd :: Natural -> Natural -> Natural
- naturalGe :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalGe# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalGt :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalGt# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalIsOne :: Natural -> GHC.Internal.Types.Bool
- naturalIsPowerOf2# :: Natural -> (# (# #) | GHC.Internal.Prim.Word# #)
- naturalIsZero :: Natural -> GHC.Internal.Types.Bool
- naturalLcm :: Natural -> Natural -> Natural
- naturalLe :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalLe# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalLog2 :: Natural -> GHC.Internal.Types.Word
- naturalLog2# :: Natural -> GHC.Internal.Prim.Word#
- naturalLogBase :: Natural -> Natural -> GHC.Internal.Types.Word
- naturalLogBase# :: Natural -> Natural -> GHC.Internal.Prim.Word#
- naturalLogBaseWord :: GHC.Internal.Types.Word -> Natural -> GHC.Internal.Types.Word
- naturalLogBaseWord# :: GHC.Internal.Prim.Word# -> Natural -> GHC.Internal.Prim.Word#
- naturalLt :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalLt# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalMul :: Natural -> Natural -> Natural
- naturalNe :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalNe# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalNegate :: Natural -> Natural
- naturalOne :: Natural
- naturalOr :: Natural -> Natural -> Natural
- naturalPopCount :: Natural -> GHC.Internal.Types.Word
- naturalPopCount# :: Natural -> GHC.Internal.Prim.Word#
- naturalPowMod :: Natural -> Natural -> Natural -> Natural
- naturalQuot :: Natural -> Natural -> Natural
- naturalQuotRem :: Natural -> Natural -> (Natural, Natural)
- naturalQuotRem# :: Natural -> Natural -> (# Natural, Natural #)
- naturalRem :: Natural -> Natural -> Natural
- naturalSetBit :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalSetBit# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalShiftL :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalShiftL# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalShiftR :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalShiftR# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalSignum :: Natural -> Natural
- naturalSizeInBase# :: GHC.Internal.Prim.Word# -> Natural -> GHC.Internal.Prim.Word#
- naturalSqr :: Natural -> Natural
- naturalSub :: Natural -> Natural -> (# (# #) | Natural #)
- naturalSubThrow :: Natural -> Natural -> Natural
- naturalSubUnsafe :: Natural -> Natural -> Natural
- naturalTestBit :: Natural -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- naturalTestBit# :: Natural -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- naturalToAddr :: Natural -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO GHC.Internal.Types.Word
- naturalToAddr# :: forall s. Natural -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- naturalToBigNat# :: Natural -> GHC.Internal.Bignum.BigNat.BigNat#
- naturalToMutableByteArray# :: forall s. Natural -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- naturalToWord :: Natural -> GHC.Internal.Types.Word
- naturalToWord# :: Natural -> GHC.Internal.Prim.Word#
- naturalToWordClamp :: Natural -> GHC.Internal.Types.Word
- naturalToWordClamp# :: Natural -> GHC.Internal.Prim.Word#
- naturalToWordMaybe# :: Natural -> (# (# #) | GHC.Internal.Prim.Word# #)
- naturalXor :: Natural -> Natural -> Natural
- naturalZero :: Natural
-
module GHC.OldList where
-- Safety: Safe
(!!) :: forall a. GHC.Internal.Stack.Types.HasCallStack => [a] -> GHC.Internal.Types.Int -> a
=====================================
testsuite/tests/interface-stability/base-exports.stdout-mingw32
=====================================
@@ -8768,340 +8768,6 @@ module GHC.Num where
quotRemInteger :: Integer -> Integer -> (# Integer, Integer #)
subtract :: forall a. Num a => a -> a -> a
-module GHC.Num.BigNat where
- -- Safety: None
- type BigNat :: *
- data BigNat = BN# {unBigNat :: BigNat#}
- type BigNat# :: GHC.Internal.Types.UnliftedType
- type BigNat# = GHC.Internal.Bignum.WordArray.WordArray#
- bigNatAdd :: BigNat# -> BigNat# -> BigNat#
- bigNatAddWord :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatAddWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatAnd :: BigNat# -> BigNat# -> BigNat#
- bigNatAndInt# :: BigNat# -> GHC.Internal.Prim.Int# -> BigNat#
- bigNatAndNot :: BigNat# -> BigNat# -> BigNat#
- bigNatAndNotWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatAndWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatBit :: GHC.Internal.Types.Word -> BigNat#
- bigNatBit# :: GHC.Internal.Prim.Word# -> BigNat#
- bigNatCheck :: BigNat# -> GHC.Internal.Types.Bool
- bigNatCheck# :: BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatClearBit# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatCompare :: BigNat# -> BigNat# -> GHC.Internal.Types.Ordering
- bigNatCompareWord :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Ordering
- bigNatCompareWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Types.Ordering
- bigNatComplementBit# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatCtz :: BigNat# -> GHC.Internal.Types.Word
- bigNatCtz# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatCtzWord :: BigNat# -> GHC.Internal.Types.Word
- bigNatCtzWord# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatEncodeDouble# :: BigNat# -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Double#
- bigNatEq :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatEq# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatEqWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatFromAbsInt# :: GHC.Internal.Prim.Int# -> BigNat#
- bigNatFromAddr# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromAddrBE# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromAddrLE# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromByteArray# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromByteArrayBE# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromByteArrayLE# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromWord :: GHC.Internal.Types.Word -> BigNat#
- bigNatFromWord# :: GHC.Internal.Prim.Word# -> BigNat#
- bigNatFromWord2# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatFromWord64# :: GHC.Internal.Prim.Word64# -> BigNat#
- bigNatFromWordArray :: GHC.Internal.Bignum.WordArray.WordArray# -> GHC.Internal.Prim.Word# -> BigNat
- bigNatFromWordArray# :: GHC.Internal.Bignum.WordArray.WordArray# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatFromWordList :: [GHC.Internal.Types.Word] -> BigNat#
- bigNatFromWordList# :: [GHC.Internal.Types.Word] -> GHC.Internal.Bignum.WordArray.WordArray#
- bigNatFromWordListUnsafe :: [GHC.Internal.Types.Word] -> BigNat#
- bigNatGcd :: BigNat# -> BigNat# -> BigNat#
- bigNatGcdWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- bigNatGe :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatGe# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatGt :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatGt# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatGtWord :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- bigNatGtWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatIndex :: BigNat# -> GHC.Internal.Prim.Int# -> GHC.Internal.Types.Word
- bigNatIndex# :: BigNat# -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Word#
- bigNatIsOne :: BigNat# -> GHC.Internal.Types.Bool
- bigNatIsOne# :: BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatIsPowerOf2# :: BigNat# -> (# (# #) | GHC.Internal.Prim.Word# #)
- bigNatIsTwo :: BigNat# -> GHC.Internal.Types.Bool
- bigNatIsTwo# :: BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatIsZero :: BigNat# -> GHC.Internal.Types.Bool
- bigNatIsZero# :: BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatLcm :: BigNat# -> BigNat# -> BigNat#
- bigNatLcmWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatLcmWordWord# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatLe :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatLe# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatLeWord :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- bigNatLeWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatLog2 :: BigNat# -> GHC.Internal.Types.Word
- bigNatLog2# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatLogBase :: BigNat# -> BigNat# -> GHC.Internal.Types.Word
- bigNatLogBase# :: BigNat# -> BigNat# -> GHC.Internal.Prim.Word#
- bigNatLogBaseWord :: GHC.Internal.Types.Word -> BigNat# -> GHC.Internal.Types.Word
- bigNatLogBaseWord# :: GHC.Internal.Prim.Word# -> BigNat# -> GHC.Internal.Prim.Word#
- bigNatLt :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatLt# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatMul :: BigNat# -> BigNat# -> BigNat#
- bigNatMulWord :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatMulWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatNe :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatNe# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatOne :: BigNat
- bigNatOne# :: (# #) -> BigNat#
- bigNatOr :: BigNat# -> BigNat# -> BigNat#
- bigNatOrWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatPopCount :: BigNat# -> GHC.Internal.Types.Word
- bigNatPopCount# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatPowMod :: BigNat# -> BigNat# -> BigNat# -> BigNat#
- bigNatPowModWord# :: BigNat# -> BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- bigNatQuot :: BigNat# -> BigNat# -> BigNat#
- bigNatQuotRem# :: BigNat# -> BigNat# -> (# BigNat#, BigNat# #)
- bigNatQuotRemWord# :: BigNat# -> GHC.Internal.Prim.Word# -> (# BigNat#, GHC.Internal.Prim.Word# #)
- bigNatQuotWord :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatQuotWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatRem :: BigNat# -> BigNat# -> BigNat#
- bigNatRemWord :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Word
- bigNatRemWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- bigNatSetBit# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatShiftL :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatShiftL# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatShiftR :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatShiftR# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatShiftRNeg# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatSize :: BigNat# -> GHC.Internal.Types.Word
- bigNatSize# :: BigNat# -> GHC.Internal.Prim.Int#
- bigNatSizeInBase :: GHC.Internal.Types.Word -> BigNat# -> GHC.Internal.Types.Word
- bigNatSizeInBase# :: GHC.Internal.Prim.Word# -> BigNat# -> GHC.Internal.Prim.Word#
- bigNatSqr :: BigNat# -> BigNat#
- bigNatSub :: BigNat# -> BigNat# -> (# (# #) | BigNat# #)
- bigNatSubUnsafe :: BigNat# -> BigNat# -> BigNat#
- bigNatSubWord# :: BigNat# -> GHC.Internal.Prim.Word# -> (# (# #) | BigNat# #)
- bigNatSubWordUnsafe :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatSubWordUnsafe# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatTestBit :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- bigNatTestBit# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatToAddr :: BigNat# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO GHC.Internal.Types.Word
- bigNatToAddr# :: forall s. BigNat# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToAddrBE# :: forall s. BigNat# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToAddrLE# :: forall s. BigNat# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToInt :: BigNat# -> GHC.Internal.Types.Int
- bigNatToInt# :: BigNat# -> GHC.Internal.Prim.Int#
- bigNatToMutableByteArray# :: forall s. BigNat# -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToMutableByteArrayBE# :: forall s. BigNat# -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToMutableByteArrayLE# :: forall s. BigNat# -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToWord :: BigNat# -> GHC.Internal.Types.Word
- bigNatToWord# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatToWord64# :: BigNat# -> GHC.Internal.Prim.Word64#
- bigNatToWordList :: BigNat# -> [GHC.Internal.Types.Word]
- bigNatToWordMaybe# :: BigNat# -> (# (# #) | GHC.Internal.Prim.Word# #)
- bigNatXor :: BigNat# -> BigNat# -> BigNat#
- bigNatXorWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatZero :: BigNat
- bigNatZero# :: (# #) -> BigNat#
- gcdInt :: GHC.Internal.Types.Int -> GHC.Internal.Types.Int -> GHC.Internal.Types.Int
- gcdInt# :: GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Int#
- gcdWord :: GHC.Internal.Types.Word -> GHC.Internal.Types.Word -> GHC.Internal.Types.Word
- gcdWord# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- powModWord# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- raiseDivZero_BigNat :: (# #) -> BigNat#
-
-module GHC.Num.Integer where
- -- Safety: None
- type Integer :: *
- data Integer = IS GHC.Internal.Prim.Int# | IP GHC.Internal.Prim.ByteArray# | IN GHC.Internal.Prim.ByteArray#
- integerAbs :: Integer -> Integer
- integerAdd :: Integer -> Integer -> Integer
- integerAnd :: Integer -> Integer -> Integer
- integerBit :: GHC.Internal.Types.Word -> Integer
- integerBit# :: GHC.Internal.Prim.Word# -> Integer
- integerCheck :: Integer -> GHC.Internal.Types.Bool
- integerCheck# :: Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerCompare :: Integer -> Integer -> GHC.Internal.Types.Ordering
- integerComplement :: Integer -> Integer
- integerDecodeDouble# :: GHC.Internal.Prim.Double# -> (# Integer, GHC.Internal.Prim.Int# #)
- integerDiv :: Integer -> Integer -> Integer
- integerDivMod :: Integer -> Integer -> (Integer, Integer)
- integerDivMod# :: Integer -> Integer -> (# Integer, Integer #)
- integerEncodeDouble :: Integer -> GHC.Internal.Types.Int -> GHC.Internal.Types.Double
- integerEncodeDouble# :: Integer -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Double#
- integerEncodeFloat# :: Integer -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Float#
- integerEq :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerEq# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerFromAddr :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO Integer
- integerFromAddr# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, Integer #)
- integerFromBigNat# :: GHC.Internal.Bignum.BigNat.BigNat# -> Integer
- integerFromBigNatNeg# :: GHC.Internal.Bignum.BigNat.BigNat# -> Integer
- integerFromBigNatSign# :: GHC.Internal.Prim.Int# -> GHC.Internal.Bignum.BigNat.BigNat# -> Integer
- integerFromByteArray :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> Integer
- integerFromByteArray# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, Integer #)
- integerFromInt :: GHC.Internal.Types.Int -> Integer
- integerFromInt# :: GHC.Internal.Prim.Int# -> Integer
- integerFromInt64# :: GHC.Internal.Prim.Int64# -> Integer
- integerFromNatural :: GHC.Internal.Bignum.Natural.Natural -> Integer
- integerFromWord :: GHC.Internal.Types.Word -> Integer
- integerFromWord# :: GHC.Internal.Prim.Word# -> Integer
- integerFromWord64# :: GHC.Internal.Prim.Word64# -> Integer
- integerFromWordList :: GHC.Internal.Types.Bool -> [GHC.Internal.Types.Word] -> Integer
- integerFromWordNeg# :: GHC.Internal.Prim.Word# -> Integer
- integerFromWordSign# :: GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Word# -> Integer
- integerGcd :: Integer -> Integer -> Integer
- integerGcde :: Integer -> Integer -> (Integer, Integer, Integer)
- integerGcde# :: Integer -> Integer -> (# Integer, Integer, Integer #)
- integerGe :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerGe# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerGt :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerGt# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerIsNegative :: Integer -> GHC.Internal.Types.Bool
- integerIsNegative# :: Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerIsOne :: Integer -> GHC.Internal.Types.Bool
- integerIsPowerOf2# :: Integer -> (# (# #) | GHC.Internal.Prim.Word# #)
- integerIsZero :: Integer -> GHC.Internal.Types.Bool
- integerLcm :: Integer -> Integer -> Integer
- integerLe :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerLe# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerLog2 :: Integer -> GHC.Internal.Types.Word
- integerLog2# :: Integer -> GHC.Internal.Prim.Word#
- integerLogBase :: Integer -> Integer -> GHC.Internal.Types.Word
- integerLogBase# :: Integer -> Integer -> GHC.Internal.Prim.Word#
- integerLogBaseWord :: GHC.Internal.Types.Word -> Integer -> GHC.Internal.Types.Word
- integerLogBaseWord# :: GHC.Internal.Prim.Word# -> Integer -> GHC.Internal.Prim.Word#
- integerLt :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerLt# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerMod :: Integer -> Integer -> Integer
- integerMul :: Integer -> Integer -> Integer
- integerNe :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerNe# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerNegate :: Integer -> Integer
- integerOne :: Integer
- integerOr :: Integer -> Integer -> Integer
- integerPopCount# :: Integer -> GHC.Internal.Prim.Int#
- integerPowMod# :: Integer -> Integer -> GHC.Internal.Bignum.Natural.Natural -> (# GHC.Internal.Bignum.Natural.Natural | () #)
- integerQuot :: Integer -> Integer -> Integer
- integerQuotRem :: Integer -> Integer -> (Integer, Integer)
- integerQuotRem# :: Integer -> Integer -> (# Integer, Integer #)
- integerRecipMod# :: Integer -> GHC.Internal.Bignum.Natural.Natural -> (# GHC.Internal.Bignum.Natural.Natural | () #)
- integerRem :: Integer -> Integer -> Integer
- integerShiftL :: Integer -> GHC.Internal.Types.Word -> Integer
- integerShiftL# :: Integer -> GHC.Internal.Prim.Word# -> Integer
- integerShiftR :: Integer -> GHC.Internal.Types.Word -> Integer
- integerShiftR# :: Integer -> GHC.Internal.Prim.Word# -> Integer
- integerSignum :: Integer -> Integer
- integerSignum# :: Integer -> GHC.Internal.Prim.Int#
- integerSizeInBase# :: GHC.Internal.Prim.Word# -> Integer -> GHC.Internal.Prim.Word#
- integerSqr :: Integer -> Integer
- integerSub :: Integer -> Integer -> Integer
- integerTestBit :: Integer -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- integerTestBit# :: Integer -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- integerToAddr :: Integer -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO GHC.Internal.Types.Word
- integerToAddr# :: forall s. Integer -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- integerToBigNatClamp# :: Integer -> GHC.Internal.Bignum.BigNat.BigNat#
- integerToBigNatSign# :: Integer -> (# GHC.Internal.Prim.Int#, GHC.Internal.Bignum.BigNat.BigNat# #)
- integerToInt :: Integer -> GHC.Internal.Types.Int
- integerToInt# :: Integer -> GHC.Internal.Prim.Int#
- integerToInt64# :: Integer -> GHC.Internal.Prim.Int64#
- integerToMutableByteArray :: Integer -> GHC.Internal.Prim.MutableByteArray# GHC.Internal.Prim.RealWorld -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO GHC.Internal.Types.Word
- integerToMutableByteArray# :: forall s. Integer -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- integerToNatural :: Integer -> GHC.Internal.Bignum.Natural.Natural
- integerToNaturalClamp :: Integer -> GHC.Internal.Bignum.Natural.Natural
- integerToNaturalThrow :: Integer -> GHC.Internal.Bignum.Natural.Natural
- integerToWord :: Integer -> GHC.Internal.Types.Word
- integerToWord# :: Integer -> GHC.Internal.Prim.Word#
- integerToWord64# :: Integer -> GHC.Internal.Prim.Word64#
- integerXor :: Integer -> Integer -> Integer
- integerZero :: Integer
-
-module GHC.Num.Natural where
- -- Safety: None
- type Natural :: *
- data Natural = NS GHC.Internal.Prim.Word# | NB GHC.Internal.Prim.ByteArray#
- naturalAdd :: Natural -> Natural -> Natural
- naturalAnd :: Natural -> Natural -> Natural
- naturalAndNot :: Natural -> Natural -> Natural
- naturalBit :: GHC.Internal.Types.Word -> Natural
- naturalBit# :: GHC.Internal.Prim.Word# -> Natural
- naturalCheck :: Natural -> GHC.Internal.Types.Bool
- naturalCheck# :: Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalClearBit :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalClearBit# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalCompare :: Natural -> Natural -> GHC.Internal.Types.Ordering
- naturalComplementBit :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalComplementBit# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalEncodeDouble# :: Natural -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Double#
- naturalEncodeFloat# :: Natural -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Float#
- naturalEq :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalEq# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalFromAddr :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO Natural
- naturalFromAddr# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, Natural #)
- naturalFromBigNat# :: GHC.Internal.Bignum.BigNat.BigNat# -> Natural
- naturalFromByteArray# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, Natural #)
- naturalFromWord :: GHC.Internal.Types.Word -> Natural
- naturalFromWord# :: GHC.Internal.Prim.Word# -> Natural
- naturalFromWord2# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> Natural
- naturalFromWordList :: [GHC.Internal.Types.Word] -> Natural
- naturalGcd :: Natural -> Natural -> Natural
- naturalGe :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalGe# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalGt :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalGt# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalIsOne :: Natural -> GHC.Internal.Types.Bool
- naturalIsPowerOf2# :: Natural -> (# (# #) | GHC.Internal.Prim.Word# #)
- naturalIsZero :: Natural -> GHC.Internal.Types.Bool
- naturalLcm :: Natural -> Natural -> Natural
- naturalLe :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalLe# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalLog2 :: Natural -> GHC.Internal.Types.Word
- naturalLog2# :: Natural -> GHC.Internal.Prim.Word#
- naturalLogBase :: Natural -> Natural -> GHC.Internal.Types.Word
- naturalLogBase# :: Natural -> Natural -> GHC.Internal.Prim.Word#
- naturalLogBaseWord :: GHC.Internal.Types.Word -> Natural -> GHC.Internal.Types.Word
- naturalLogBaseWord# :: GHC.Internal.Prim.Word# -> Natural -> GHC.Internal.Prim.Word#
- naturalLt :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalLt# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalMul :: Natural -> Natural -> Natural
- naturalNe :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalNe# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalNegate :: Natural -> Natural
- naturalOne :: Natural
- naturalOr :: Natural -> Natural -> Natural
- naturalPopCount :: Natural -> GHC.Internal.Types.Word
- naturalPopCount# :: Natural -> GHC.Internal.Prim.Word#
- naturalPowMod :: Natural -> Natural -> Natural -> Natural
- naturalQuot :: Natural -> Natural -> Natural
- naturalQuotRem :: Natural -> Natural -> (Natural, Natural)
- naturalQuotRem# :: Natural -> Natural -> (# Natural, Natural #)
- naturalRem :: Natural -> Natural -> Natural
- naturalSetBit :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalSetBit# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalShiftL :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalShiftL# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalShiftR :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalShiftR# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalSignum :: Natural -> Natural
- naturalSizeInBase# :: GHC.Internal.Prim.Word# -> Natural -> GHC.Internal.Prim.Word#
- naturalSqr :: Natural -> Natural
- naturalSub :: Natural -> Natural -> (# (# #) | Natural #)
- naturalSubThrow :: Natural -> Natural -> Natural
- naturalSubUnsafe :: Natural -> Natural -> Natural
- naturalTestBit :: Natural -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- naturalTestBit# :: Natural -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- naturalToAddr :: Natural -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO GHC.Internal.Types.Word
- naturalToAddr# :: forall s. Natural -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- naturalToBigNat# :: Natural -> GHC.Internal.Bignum.BigNat.BigNat#
- naturalToMutableByteArray# :: forall s. Natural -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- naturalToWord :: Natural -> GHC.Internal.Types.Word
- naturalToWord# :: Natural -> GHC.Internal.Prim.Word#
- naturalToWordClamp :: Natural -> GHC.Internal.Types.Word
- naturalToWordClamp# :: Natural -> GHC.Internal.Prim.Word#
- naturalToWordMaybe# :: Natural -> (# (# #) | GHC.Internal.Prim.Word# #)
- naturalXor :: Natural -> Natural -> Natural
- naturalZero :: Natural
-
module GHC.OldList where
-- Safety: Safe
(!!) :: forall a. GHC.Internal.Stack.Types.HasCallStack => [a] -> GHC.Internal.Types.Int -> a
=====================================
testsuite/tests/interface-stability/base-exports.stdout-ws-32
=====================================
@@ -8550,340 +8550,6 @@ module GHC.Num where
quotRemInteger :: Integer -> Integer -> (# Integer, Integer #)
subtract :: forall a. Num a => a -> a -> a
-module GHC.Num.BigNat where
- -- Safety: None
- type BigNat :: *
- data BigNat = BN# {unBigNat :: BigNat#}
- type BigNat# :: GHC.Internal.Types.UnliftedType
- type BigNat# = GHC.Internal.Bignum.WordArray.WordArray#
- bigNatAdd :: BigNat# -> BigNat# -> BigNat#
- bigNatAddWord :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatAddWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatAnd :: BigNat# -> BigNat# -> BigNat#
- bigNatAndInt# :: BigNat# -> GHC.Internal.Prim.Int# -> BigNat#
- bigNatAndNot :: BigNat# -> BigNat# -> BigNat#
- bigNatAndNotWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatAndWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatBit :: GHC.Internal.Types.Word -> BigNat#
- bigNatBit# :: GHC.Internal.Prim.Word# -> BigNat#
- bigNatCheck :: BigNat# -> GHC.Internal.Types.Bool
- bigNatCheck# :: BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatClearBit# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatCompare :: BigNat# -> BigNat# -> GHC.Internal.Types.Ordering
- bigNatCompareWord :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Ordering
- bigNatCompareWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Types.Ordering
- bigNatComplementBit# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatCtz :: BigNat# -> GHC.Internal.Types.Word
- bigNatCtz# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatCtzWord :: BigNat# -> GHC.Internal.Types.Word
- bigNatCtzWord# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatEncodeDouble# :: BigNat# -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Double#
- bigNatEq :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatEq# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatEqWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatFromAbsInt# :: GHC.Internal.Prim.Int# -> BigNat#
- bigNatFromAddr# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromAddrBE# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromAddrLE# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromByteArray# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromByteArrayBE# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromByteArrayLE# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, BigNat# #)
- bigNatFromWord :: GHC.Internal.Types.Word -> BigNat#
- bigNatFromWord# :: GHC.Internal.Prim.Word# -> BigNat#
- bigNatFromWord2# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatFromWord64# :: GHC.Internal.Prim.Word64# -> BigNat#
- bigNatFromWordArray :: GHC.Internal.Bignum.WordArray.WordArray# -> GHC.Internal.Prim.Word# -> BigNat
- bigNatFromWordArray# :: GHC.Internal.Bignum.WordArray.WordArray# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatFromWordList :: [GHC.Internal.Types.Word] -> BigNat#
- bigNatFromWordList# :: [GHC.Internal.Types.Word] -> GHC.Internal.Bignum.WordArray.WordArray#
- bigNatFromWordListUnsafe :: [GHC.Internal.Types.Word] -> BigNat#
- bigNatGcd :: BigNat# -> BigNat# -> BigNat#
- bigNatGcdWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- bigNatGe :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatGe# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatGt :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatGt# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatGtWord :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- bigNatGtWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatIndex :: BigNat# -> GHC.Internal.Prim.Int# -> GHC.Internal.Types.Word
- bigNatIndex# :: BigNat# -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Word#
- bigNatIsOne :: BigNat# -> GHC.Internal.Types.Bool
- bigNatIsOne# :: BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatIsPowerOf2# :: BigNat# -> (# (# #) | GHC.Internal.Prim.Word# #)
- bigNatIsTwo :: BigNat# -> GHC.Internal.Types.Bool
- bigNatIsTwo# :: BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatIsZero :: BigNat# -> GHC.Internal.Types.Bool
- bigNatIsZero# :: BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatLcm :: BigNat# -> BigNat# -> BigNat#
- bigNatLcmWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatLcmWordWord# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatLe :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatLe# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatLeWord :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- bigNatLeWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatLog2 :: BigNat# -> GHC.Internal.Types.Word
- bigNatLog2# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatLogBase :: BigNat# -> BigNat# -> GHC.Internal.Types.Word
- bigNatLogBase# :: BigNat# -> BigNat# -> GHC.Internal.Prim.Word#
- bigNatLogBaseWord :: GHC.Internal.Types.Word -> BigNat# -> GHC.Internal.Types.Word
- bigNatLogBaseWord# :: GHC.Internal.Prim.Word# -> BigNat# -> GHC.Internal.Prim.Word#
- bigNatLt :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatLt# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatMul :: BigNat# -> BigNat# -> BigNat#
- bigNatMulWord :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatMulWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatNe :: BigNat# -> BigNat# -> GHC.Internal.Types.Bool
- bigNatNe# :: BigNat# -> BigNat# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatOne :: BigNat
- bigNatOne# :: (# #) -> BigNat#
- bigNatOr :: BigNat# -> BigNat# -> BigNat#
- bigNatOrWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatPopCount :: BigNat# -> GHC.Internal.Types.Word
- bigNatPopCount# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatPowMod :: BigNat# -> BigNat# -> BigNat# -> BigNat#
- bigNatPowModWord# :: BigNat# -> BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- bigNatQuot :: BigNat# -> BigNat# -> BigNat#
- bigNatQuotRem# :: BigNat# -> BigNat# -> (# BigNat#, BigNat# #)
- bigNatQuotRemWord# :: BigNat# -> GHC.Internal.Prim.Word# -> (# BigNat#, GHC.Internal.Prim.Word# #)
- bigNatQuotWord :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatQuotWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatRem :: BigNat# -> BigNat# -> BigNat#
- bigNatRemWord :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Word
- bigNatRemWord# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- bigNatSetBit# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatShiftL :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatShiftL# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatShiftR :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatShiftR# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatShiftRNeg# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatSize :: BigNat# -> GHC.Internal.Types.Word
- bigNatSize# :: BigNat# -> GHC.Internal.Prim.Int#
- bigNatSizeInBase :: GHC.Internal.Types.Word -> BigNat# -> GHC.Internal.Types.Word
- bigNatSizeInBase# :: GHC.Internal.Prim.Word# -> BigNat# -> GHC.Internal.Prim.Word#
- bigNatSqr :: BigNat# -> BigNat#
- bigNatSub :: BigNat# -> BigNat# -> (# (# #) | BigNat# #)
- bigNatSubUnsafe :: BigNat# -> BigNat# -> BigNat#
- bigNatSubWord# :: BigNat# -> GHC.Internal.Prim.Word# -> (# (# #) | BigNat# #)
- bigNatSubWordUnsafe :: BigNat# -> GHC.Internal.Types.Word -> BigNat#
- bigNatSubWordUnsafe# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatTestBit :: BigNat# -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- bigNatTestBit# :: BigNat# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- bigNatToAddr :: BigNat# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO GHC.Internal.Types.Word
- bigNatToAddr# :: forall s. BigNat# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToAddrBE# :: forall s. BigNat# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToAddrLE# :: forall s. BigNat# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToInt :: BigNat# -> GHC.Internal.Types.Int
- bigNatToInt# :: BigNat# -> GHC.Internal.Prim.Int#
- bigNatToMutableByteArray# :: forall s. BigNat# -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToMutableByteArrayBE# :: forall s. BigNat# -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToMutableByteArrayLE# :: forall s. BigNat# -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- bigNatToWord :: BigNat# -> GHC.Internal.Types.Word
- bigNatToWord# :: BigNat# -> GHC.Internal.Prim.Word#
- bigNatToWord64# :: BigNat# -> GHC.Internal.Prim.Word64#
- bigNatToWordList :: BigNat# -> [GHC.Internal.Types.Word]
- bigNatToWordMaybe# :: BigNat# -> (# (# #) | GHC.Internal.Prim.Word# #)
- bigNatXor :: BigNat# -> BigNat# -> BigNat#
- bigNatXorWord# :: BigNat# -> GHC.Internal.Prim.Word# -> BigNat#
- bigNatZero :: BigNat
- bigNatZero# :: (# #) -> BigNat#
- gcdInt :: GHC.Internal.Types.Int -> GHC.Internal.Types.Int -> GHC.Internal.Types.Int
- gcdInt# :: GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Int#
- gcdWord :: GHC.Internal.Types.Word -> GHC.Internal.Types.Word -> GHC.Internal.Types.Word
- gcdWord# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- powModWord# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word#
- raiseDivZero_BigNat :: (# #) -> BigNat#
-
-module GHC.Num.Integer where
- -- Safety: None
- type Integer :: *
- data Integer = IS GHC.Internal.Prim.Int# | IP GHC.Internal.Prim.ByteArray# | IN GHC.Internal.Prim.ByteArray#
- integerAbs :: Integer -> Integer
- integerAdd :: Integer -> Integer -> Integer
- integerAnd :: Integer -> Integer -> Integer
- integerBit :: GHC.Internal.Types.Word -> Integer
- integerBit# :: GHC.Internal.Prim.Word# -> Integer
- integerCheck :: Integer -> GHC.Internal.Types.Bool
- integerCheck# :: Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerCompare :: Integer -> Integer -> GHC.Internal.Types.Ordering
- integerComplement :: Integer -> Integer
- integerDecodeDouble# :: GHC.Internal.Prim.Double# -> (# Integer, GHC.Internal.Prim.Int# #)
- integerDiv :: Integer -> Integer -> Integer
- integerDivMod :: Integer -> Integer -> (Integer, Integer)
- integerDivMod# :: Integer -> Integer -> (# Integer, Integer #)
- integerEncodeDouble :: Integer -> GHC.Internal.Types.Int -> GHC.Internal.Types.Double
- integerEncodeDouble# :: Integer -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Double#
- integerEncodeFloat# :: Integer -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Float#
- integerEq :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerEq# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerFromAddr :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO Integer
- integerFromAddr# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, Integer #)
- integerFromBigNat# :: GHC.Internal.Bignum.BigNat.BigNat# -> Integer
- integerFromBigNatNeg# :: GHC.Internal.Bignum.BigNat.BigNat# -> Integer
- integerFromBigNatSign# :: GHC.Internal.Prim.Int# -> GHC.Internal.Bignum.BigNat.BigNat# -> Integer
- integerFromByteArray :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> Integer
- integerFromByteArray# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, Integer #)
- integerFromInt :: GHC.Internal.Types.Int -> Integer
- integerFromInt# :: GHC.Internal.Prim.Int# -> Integer
- integerFromInt64# :: GHC.Internal.Prim.Int64# -> Integer
- integerFromNatural :: GHC.Internal.Bignum.Natural.Natural -> Integer
- integerFromWord :: GHC.Internal.Types.Word -> Integer
- integerFromWord# :: GHC.Internal.Prim.Word# -> Integer
- integerFromWord64# :: GHC.Internal.Prim.Word64# -> Integer
- integerFromWordList :: GHC.Internal.Types.Bool -> [GHC.Internal.Types.Word] -> Integer
- integerFromWordNeg# :: GHC.Internal.Prim.Word# -> Integer
- integerFromWordSign# :: GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Word# -> Integer
- integerGcd :: Integer -> Integer -> Integer
- integerGcde :: Integer -> Integer -> (Integer, Integer, Integer)
- integerGcde# :: Integer -> Integer -> (# Integer, Integer, Integer #)
- integerGe :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerGe# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerGt :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerGt# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerIsNegative :: Integer -> GHC.Internal.Types.Bool
- integerIsNegative# :: Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerIsOne :: Integer -> GHC.Internal.Types.Bool
- integerIsPowerOf2# :: Integer -> (# (# #) | GHC.Internal.Prim.Word# #)
- integerIsZero :: Integer -> GHC.Internal.Types.Bool
- integerLcm :: Integer -> Integer -> Integer
- integerLe :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerLe# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerLog2 :: Integer -> GHC.Internal.Types.Word
- integerLog2# :: Integer -> GHC.Internal.Prim.Word#
- integerLogBase :: Integer -> Integer -> GHC.Internal.Types.Word
- integerLogBase# :: Integer -> Integer -> GHC.Internal.Prim.Word#
- integerLogBaseWord :: GHC.Internal.Types.Word -> Integer -> GHC.Internal.Types.Word
- integerLogBaseWord# :: GHC.Internal.Prim.Word# -> Integer -> GHC.Internal.Prim.Word#
- integerLt :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerLt# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerMod :: Integer -> Integer -> Integer
- integerMul :: Integer -> Integer -> Integer
- integerNe :: Integer -> Integer -> GHC.Internal.Types.Bool
- integerNe# :: Integer -> Integer -> GHC.Internal.Bignum.Primitives.Bool#
- integerNegate :: Integer -> Integer
- integerOne :: Integer
- integerOr :: Integer -> Integer -> Integer
- integerPopCount# :: Integer -> GHC.Internal.Prim.Int#
- integerPowMod# :: Integer -> Integer -> GHC.Internal.Bignum.Natural.Natural -> (# GHC.Internal.Bignum.Natural.Natural | () #)
- integerQuot :: Integer -> Integer -> Integer
- integerQuotRem :: Integer -> Integer -> (Integer, Integer)
- integerQuotRem# :: Integer -> Integer -> (# Integer, Integer #)
- integerRecipMod# :: Integer -> GHC.Internal.Bignum.Natural.Natural -> (# GHC.Internal.Bignum.Natural.Natural | () #)
- integerRem :: Integer -> Integer -> Integer
- integerShiftL :: Integer -> GHC.Internal.Types.Word -> Integer
- integerShiftL# :: Integer -> GHC.Internal.Prim.Word# -> Integer
- integerShiftR :: Integer -> GHC.Internal.Types.Word -> Integer
- integerShiftR# :: Integer -> GHC.Internal.Prim.Word# -> Integer
- integerSignum :: Integer -> Integer
- integerSignum# :: Integer -> GHC.Internal.Prim.Int#
- integerSizeInBase# :: GHC.Internal.Prim.Word# -> Integer -> GHC.Internal.Prim.Word#
- integerSqr :: Integer -> Integer
- integerSub :: Integer -> Integer -> Integer
- integerTestBit :: Integer -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- integerTestBit# :: Integer -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- integerToAddr :: Integer -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO GHC.Internal.Types.Word
- integerToAddr# :: forall s. Integer -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- integerToBigNatClamp# :: Integer -> GHC.Internal.Bignum.BigNat.BigNat#
- integerToBigNatSign# :: Integer -> (# GHC.Internal.Prim.Int#, GHC.Internal.Bignum.BigNat.BigNat# #)
- integerToInt :: Integer -> GHC.Internal.Types.Int
- integerToInt# :: Integer -> GHC.Internal.Prim.Int#
- integerToInt64# :: Integer -> GHC.Internal.Prim.Int64#
- integerToMutableByteArray :: Integer -> GHC.Internal.Prim.MutableByteArray# GHC.Internal.Prim.RealWorld -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO GHC.Internal.Types.Word
- integerToMutableByteArray# :: forall s. Integer -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- integerToNatural :: Integer -> GHC.Internal.Bignum.Natural.Natural
- integerToNaturalClamp :: Integer -> GHC.Internal.Bignum.Natural.Natural
- integerToNaturalThrow :: Integer -> GHC.Internal.Bignum.Natural.Natural
- integerToWord :: Integer -> GHC.Internal.Types.Word
- integerToWord# :: Integer -> GHC.Internal.Prim.Word#
- integerToWord64# :: Integer -> GHC.Internal.Prim.Word64#
- integerXor :: Integer -> Integer -> Integer
- integerZero :: Integer
-
-module GHC.Num.Natural where
- -- Safety: None
- type Natural :: *
- data Natural = NS GHC.Internal.Prim.Word# | NB GHC.Internal.Prim.ByteArray#
- naturalAdd :: Natural -> Natural -> Natural
- naturalAnd :: Natural -> Natural -> Natural
- naturalAndNot :: Natural -> Natural -> Natural
- naturalBit :: GHC.Internal.Types.Word -> Natural
- naturalBit# :: GHC.Internal.Prim.Word# -> Natural
- naturalCheck :: Natural -> GHC.Internal.Types.Bool
- naturalCheck# :: Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalClearBit :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalClearBit# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalCompare :: Natural -> Natural -> GHC.Internal.Types.Ordering
- naturalComplementBit :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalComplementBit# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalEncodeDouble# :: Natural -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Double#
- naturalEncodeFloat# :: Natural -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Float#
- naturalEq :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalEq# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalFromAddr :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO Natural
- naturalFromAddr# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, Natural #)
- naturalFromBigNat# :: GHC.Internal.Bignum.BigNat.BigNat# -> Natural
- naturalFromByteArray# :: forall s. GHC.Internal.Prim.Word# -> GHC.Internal.Prim.ByteArray# -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, Natural #)
- naturalFromWord :: GHC.Internal.Types.Word -> Natural
- naturalFromWord# :: GHC.Internal.Prim.Word# -> Natural
- naturalFromWord2# :: GHC.Internal.Prim.Word# -> GHC.Internal.Prim.Word# -> Natural
- naturalFromWordList :: [GHC.Internal.Types.Word] -> Natural
- naturalGcd :: Natural -> Natural -> Natural
- naturalGe :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalGe# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalGt :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalGt# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalIsOne :: Natural -> GHC.Internal.Types.Bool
- naturalIsPowerOf2# :: Natural -> (# (# #) | GHC.Internal.Prim.Word# #)
- naturalIsZero :: Natural -> GHC.Internal.Types.Bool
- naturalLcm :: Natural -> Natural -> Natural
- naturalLe :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalLe# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalLog2 :: Natural -> GHC.Internal.Types.Word
- naturalLog2# :: Natural -> GHC.Internal.Prim.Word#
- naturalLogBase :: Natural -> Natural -> GHC.Internal.Types.Word
- naturalLogBase# :: Natural -> Natural -> GHC.Internal.Prim.Word#
- naturalLogBaseWord :: GHC.Internal.Types.Word -> Natural -> GHC.Internal.Types.Word
- naturalLogBaseWord# :: GHC.Internal.Prim.Word# -> Natural -> GHC.Internal.Prim.Word#
- naturalLt :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalLt# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalMul :: Natural -> Natural -> Natural
- naturalNe :: Natural -> Natural -> GHC.Internal.Types.Bool
- naturalNe# :: Natural -> Natural -> GHC.Internal.Bignum.Primitives.Bool#
- naturalNegate :: Natural -> Natural
- naturalOne :: Natural
- naturalOr :: Natural -> Natural -> Natural
- naturalPopCount :: Natural -> GHC.Internal.Types.Word
- naturalPopCount# :: Natural -> GHC.Internal.Prim.Word#
- naturalPowMod :: Natural -> Natural -> Natural -> Natural
- naturalQuot :: Natural -> Natural -> Natural
- naturalQuotRem :: Natural -> Natural -> (Natural, Natural)
- naturalQuotRem# :: Natural -> Natural -> (# Natural, Natural #)
- naturalRem :: Natural -> Natural -> Natural
- naturalSetBit :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalSetBit# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalShiftL :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalShiftL# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalShiftR :: Natural -> GHC.Internal.Types.Word -> Natural
- naturalShiftR# :: Natural -> GHC.Internal.Prim.Word# -> Natural
- naturalSignum :: Natural -> Natural
- naturalSizeInBase# :: GHC.Internal.Prim.Word# -> Natural -> GHC.Internal.Prim.Word#
- naturalSqr :: Natural -> Natural
- naturalSub :: Natural -> Natural -> (# (# #) | Natural #)
- naturalSubThrow :: Natural -> Natural -> Natural
- naturalSubUnsafe :: Natural -> Natural -> Natural
- naturalTestBit :: Natural -> GHC.Internal.Types.Word -> GHC.Internal.Types.Bool
- naturalTestBit# :: Natural -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool#
- naturalToAddr :: Natural -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Types.IO GHC.Internal.Types.Word
- naturalToAddr# :: forall s. Natural -> GHC.Internal.Prim.Addr# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- naturalToBigNat# :: Natural -> GHC.Internal.Bignum.BigNat.BigNat#
- naturalToMutableByteArray# :: forall s. Natural -> GHC.Internal.Prim.MutableByteArray# s -> GHC.Internal.Prim.Word# -> GHC.Internal.Bignum.Primitives.Bool# -> GHC.Internal.Prim.State# s -> (# GHC.Internal.Prim.State# s, GHC.Internal.Prim.Word# #)
- naturalToWord :: Natural -> GHC.Internal.Types.Word
- naturalToWord# :: Natural -> GHC.Internal.Prim.Word#
- naturalToWordClamp :: Natural -> GHC.Internal.Types.Word
- naturalToWordClamp# :: Natural -> GHC.Internal.Prim.Word#
- naturalToWordMaybe# :: Natural -> (# (# #) | GHC.Internal.Prim.Word# #)
- naturalXor :: Natural -> Natural -> Natural
- naturalZero :: Natural
-
module GHC.OldList where
-- Safety: Safe
(!!) :: forall a. GHC.Internal.Stack.Types.HasCallStack => [a] -> GHC.Internal.Types.Int -> a
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/30f442a90fb0e2384f5efc801bb9053…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/30f442a90fb0e2384f5efc801bb9053…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/spj-try-opt-coercion] Care with the simple refl optimiser [skip ci]
by Simon Peyton Jones (@simonpj) 20 Jan '26
by Simon Peyton Jones (@simonpj) 20 Jan '26
20 Jan '26
Simon Peyton Jones pushed to branch wip/spj-try-opt-coercion at Glasgow Haskell Compiler / GHC
Commits:
52c7e75f by Simon Peyton Jones at 2026-01-20T17:47:22+00:00
Care with the simple refl optimiser [skip ci]
- - - - -
5 changed files:
- compiler/GHC/Core/Coercion/Opt.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/Driver/Config.hs
- compiler/GHC/Driver/Config/Core/Lint.hs
Changes:
=====================================
compiler/GHC/Core/Coercion/Opt.hs
=====================================
@@ -300,8 +300,13 @@ optCoRefl check_stuff subst in_co
out_co
opt_co_refl :: Subst -> InCoercion -> OutCoercion
-opt_co_refl subst co = go co
+opt_co_refl subst co
+ | lk `eqTypeIgnoringMultiplicity` rk = mkReflCo (coercionRole co) lk
+ | otherwise = out_co
where
+ out_co = go co
+ Pair lk rk = coercionKind out_co
+
go_m MRefl = MRefl
go_m (MCo co) = MCo (go co)
@@ -339,14 +344,25 @@ opt_co_refl subst co = go co
where
!(subst', v') = substVarBndr subst v
- -- This is the main payload
- go (TransCo co1 co2) = gobble gs0 co1 [co2]
+ -- The TransCo case fires up the main loop for
+ -- eliminating reflexive chains of TransCo
+ go (TransCo co1 co2)
+ | lk' `eqTypeIgnoringMultiplicity` rk' = go co2
+ | otherwise = gobble0 gs1 [co2]
where
- lk' = substTy subst (coercionLKind co1)
+ co1' = go co1
+ Pair lk' rk' = coercionKind co1
role = coercionRole co1
- gs0 :: GobbleState
- gs0 = GS (mkReflCo role lk') (insertTM lk' gs0 emptyTM)
+ gs0, gs1 :: GobbleState
+ gs0 = GS (mkReflCo role lk') tm0
+ gs1 = GS co1' (insertTM rk' gs1 tm0)
+
+ tm0 = insertTM lk' gs0 emptyTM
+
+ gobble0 :: GobbleState -> [InCoercion] -> OutCoercion
+ gobble0 (GS co _) [] = co
+ gobble0 gs (co:cos) = gobble gs co cos
gobble :: GobbleState -> InCoercion -> [InCoercion] -> OutCoercion
-- gobble (GS co1 tm) co2 cos returns a coercion equivalent to (co1;co2;cos)
@@ -361,8 +377,6 @@ opt_co_refl subst co = go co
rk' = coercionRKind co2'
gs' = GS (co1' `mkTransCo` co2') (insertTM rk' gs' tm)
- gobble0 (GS co _) [] = co
- gobble0 gs (co:cos) = gobble gs co cos
data GobbleState = GS OutCoercion (TypeMap GobbleState)
-- The map is keyed by OutType
=====================================
compiler/GHC/Core/Opt/Simplify/Iteration.hs
=====================================
@@ -26,6 +26,7 @@ import GHC.Core.Opt.OccurAnal ( occurAnalyseExpr, zapLambdaBndrs, scrutOkForBind
import GHC.Core.Make ( FloatBind, mkImpossibleExpr, castBottomExpr )
import qualified GHC.Core.Make
import GHC.Core.Coercion hiding ( substCo, substCoVar )
+import qualified GHC.Core.Coercion as Coercion
import GHC.Core.Coercion.Opt
import GHC.Core.Reduction
import GHC.Core.FamInstEnv ( FamInstEnv, topNormaliseType_maybe )
@@ -1391,19 +1392,20 @@ simplCoercionF env co cont
simplCoercion :: SimplEnv -> InCoercion -> SimplM OutCoercion
simplCoercion env co
= do { let out_co | sm_opt_refl_co mode
- , not (isEmptyTCvSubst subst) || initial_phase
- = optCoRefl (sm_check_opt_co mode) subst co
- | otherwise
- = substCo env co
- subst = getTCvSubst env
- initial_phase = case sePhase env of
- SimplPhase InitialPhase -> True
- _ -> False
+ = if isEmptyTCvSubst subst
+ then co
+ else optCoRefl chk_opts subst co
+ | otherwise -- substCo also has a shortcut
+ -- when substitution is empty
+ = Coercion.substCo subst co
; seqCo out_co `seq`
return out_co }
where
- mode = seMode env
+ mode = seMode env
+ chk_opts = sm_check_opt_co mode
+ subst = getTCvSubst env
+
-----------------------------------
-- | Push a TickIt context outwards past applications and cases, as
=====================================
compiler/GHC/Core/SimpleOpt.hs
=====================================
@@ -34,6 +34,7 @@ import GHC.Core.Type hiding ( substTy, extendTvSubst, extendCvSubst, extendTvSub
, isInScope, substTyVarBndr, cloneTyVarBndr )
import GHC.Core.Predicate( isCoVarType )
import GHC.Core.Coercion hiding ( substCo, substCoVarBndr )
+import GHC.Core.Coercion.Opt( optCoRefl )
import GHC.Types.Literal
import GHC.Types.Id
@@ -115,14 +116,18 @@ data SimpleOpts = SimpleOpts
, so_eta_red :: !Bool -- ^ Eta reduction on?
, so_inline :: !Bool -- ^ False <=> do no inlining whatsoever,
-- even for trivial or used-once things
+ , so_opt_co :: !Bool -- ^ Run the simple `optCoRefl` optimiser on coercions
+ , so_check_opt_co :: !Bool -- ^ Do debug-checking for `optCoRefl`
}
-- | Default options for the Simple optimiser.
defaultSimpleOpts :: SimpleOpts
defaultSimpleOpts = SimpleOpts
- { so_uf_opts = defaultUnfoldingOpts
- , so_eta_red = False
- , so_inline = True
+ { so_uf_opts = defaultUnfoldingOpts
+ , so_eta_red = False
+ , so_inline = True
+ , so_opt_co = True
+ , so_check_opt_co = False
}
simpleOptExpr :: HasDebugCallStack => SimpleOpts -> CoreExpr -> CoreExpr
@@ -327,19 +332,15 @@ simple_opt_expr env expr = go expr
(env', bndrs') = subst_opt_bndrs env bndrs
simple_opt_co :: SimpleOptEnv -> InCoercion -> OutCoercion
-simple_opt_co env co = substCo (soe_subst env) co
-
-mk_cast :: CoreExpr -> CoercionR -> CoreExpr
--- Like GHC.Core.Utils.mkCast, but does a full reflexivity check.
--- mkCast doesn't do that because the Simplifier does (in simplCast)
--- But in SimpleOpt it's nice to kill those nested casts (#18112)
-mk_cast (Cast e co1) co2 = mk_cast e (co1 `mkTransCo` co2)
-mk_cast (Tick t e) co = Tick t (mk_cast e co)
-mk_cast e co
- | isReflexiveCo co
- = e
- | otherwise
- = Cast e co
+-- Optimise a coercion, optionally running
+-- the simple `optCoRefl` optimiser
+-- If (so_opt_co opts) is on, we run the optimiser even if the substition
+-- is empty, to kill off Refls; but if not, `substCo` does a no-op if
+-- the substitution is empty
+simple_opt_co (SOE { soe_subst = subst, soe_opts = opts }) co
+ | so_opt_co opts = optCoRefl (so_check_opt_co opts) subst co
+ | otherwise = substCo subst co
+
----------------------
-- simple_app collects arguments for beta reduction
@@ -406,8 +407,8 @@ simple_app env e0@(Lam {}) as0@(_:_)
| otherwise
= rebuild_app env (simple_opt_expr env e) as
- do_beta env (Cast e co) as =
- do_beta env e (add_cast env co as)
+ do_beta env (Cast e co) as
+ = do_beta env e (add_cast env co as)
do_beta env body as
= simple_app env body as
@@ -478,7 +479,7 @@ rebuild_app env fun args = foldl mk_app fun args
in_scope = soeInScope env
mk_app out_fun = \case
ApplyToArg arg -> App out_fun (simple_opt_clo in_scope arg)
- CastIt co -> mk_cast out_fun co
+ CastIt co -> mkCast out_fun co
{- Note [Desugaring unlifted newtypes]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=====================================
compiler/GHC/Driver/Config.hs
=====================================
@@ -18,6 +18,8 @@ initSimpleOpts dflags = SimpleOpts
{ so_uf_opts = unfoldingOpts dflags
, so_eta_red = gopt Opt_DoEtaReduction dflags
, so_inline = True
+ , so_opt_co = gopt Opt_OptReflCoercion dflags
+ , so_check_opt_co = dopt Opt_D_opt_co dflags
}
-- | Instruct the interpreter evaluation to break...
=====================================
compiler/GHC/Driver/Config/Core/Lint.hs
=====================================
@@ -153,7 +153,7 @@ perPassFlags dflags pass
-- `-dlinear-core-lint`: check linearity in every pass
|| -- Always check linearity just after desugaring
case pass of
- CoreDesugar -> True
+ CoreDesugar -> True -- Before even the simple optimiser
_ -> False
-- See Note [Checking for rubbish literals] in GHC.Core.Lint
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/52c7e75ff7e5de8bec9681ca0dc4063…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/52c7e75ff7e5de8bec9681ca0dc4063…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
Cheng Shao pushed to branch wip/deepseq-primop at Glasgow Haskell Compiler / GHC
Commits:
c1a8508d by Cheng Shao at 2026-01-20T17:23:07+01:00
WIP
- - - - -
7 changed files:
- + libraries/ghc-experimental/cbits/DeepSeq.cmm
- libraries/ghc-experimental/ghc-experimental.cabal.in
- + libraries/ghc-experimental/src/GHC/DeepSeq.hs
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout
- + testsuite/tests/primops/should_run/DeepSeqPrimOp.hs
- + testsuite/tests/primops/should_run/DeepSeqPrimOp.stdout
- testsuite/tests/primops/should_run/all.T
Changes:
=====================================
libraries/ghc-experimental/cbits/DeepSeq.cmm
=====================================
@@ -0,0 +1,256 @@
+/* -----------------------------------------------------------------------------
+ *
+ * (c) The GHC Team, 2025
+ *
+ * Support for the deepseq# primcall.
+ *
+ * ---------------------------------------------------------------------------*/
+
+#include "Cmm.h"
+
+/*
+Note [import CLOSURE annotations]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+See Note [import CLOSURE annotations] in rts/Apply.cmm.
+*/
+
+#if !defined(UnregisterisedCompiler)
+import CLOSURE g0;
+import CLOSURE large_alloc_lim;
+#endif
+
+/* -----------------------------------------------------------------------------
+ deepseq#
+
+ Deeply evaluate a value to (approximate) normal form, without requiring an
+ NFData constraint. This is used to provide a primitive analogue of
+ Control.DeepSeq.force / rnf.
+
+ See the GHC.DeepSeq documentation for the intended semantics and
+ limitations.
+ -------------------------------------------------------------------------- */
+
+// Worker which performs deep evaluation. This lets us tail-call when traversing
+// the final pointer field, avoiding stack blowup on common spine-recursive
+// structures (e.g. lists).
+//
+// The second argument is a boolean (0/1) accumulator tracking whether any
+// evaluation was forced in the transitive closure so far.
+stg_deepseqWorkzh (P_ p, W_ forced)
+{
+ W_ type, info;
+
+ again: MAYBE_GC(again);
+ STK_CHK_GEN();
+
+ p = UNTAG(p);
+ // Values in compact regions are already fully evaluated.
+ (W_ in_compact) = call stg_compactContainsAnyzh(p);
+ if (in_compact != 0) {
+ return (forced);
+ }
+ info = %INFO_PTR(p);
+ type = TO_W_(%INFO_TYPE(%STD_INFO(info)));
+
+ switch [0 .. N_CLOSURE_TYPES] type {
+
+ // Unevaluated things must be evaluated first:
+ case
+ THUNK,
+ THUNK_1_0,
+ THUNK_0_1,
+ THUNK_2_0,
+ THUNK_1_1,
+ THUNK_0_2,
+ THUNK_STATIC,
+ AP,
+ AP_STACK,
+ BLACKHOLE,
+ THUNK_SELECTOR : {
+ (P_ evald) = call %ENTRY_CODE(info) (p);
+ jump stg_deepseqWorkzh(evald, 1);
+ }
+
+ // Follow indirections:
+ case IND, IND_STATIC: {
+ p = %acquire StgInd_indirectee(p);
+ jump stg_deepseqWorkzh(p, forced);
+ }
+
+ // WHITEHOLEs are transient. Yield and try again.
+ case WHITEHOLE: {
+ goto again;
+ }
+
+ // Arrays of pointers: evaluate elements.
+ case
+ MUT_ARR_PTRS_DIRTY,
+ MUT_ARR_PTRS_CLEAN,
+ MUT_ARR_PTRS_FROZEN_DIRTY,
+ MUT_ARR_PTRS_FROZEN_CLEAN: {
+ W_ i_arr, ptrs_arr;
+ ptrs_arr = StgMutArrPtrs_ptrs(p);
+ if (ptrs_arr == 0) { return (forced); }
+ i_arr = ptrs_arr - 1;
+ deepseq_arr_loop0:
+ if (i_arr == 0) ( likely: False ) {
+ // Tail-call the final element to avoid building up a deep stack
+ // when traversing large immutable arrays.
+ jump stg_deepseqWorkzh(P_[p + SIZEOF_StgMutArrPtrs], forced);
+ }
+ (W_ forced_arr) = call stg_deepseqWorkzh(P_[p + SIZEOF_StgMutArrPtrs + WDS(i_arr)], forced);
+ forced = forced_arr;
+ i_arr = i_arr - 1;
+ goto deepseq_arr_loop0;
+ }
+
+ case
+ SMALL_MUT_ARR_PTRS_DIRTY,
+ SMALL_MUT_ARR_PTRS_CLEAN,
+ SMALL_MUT_ARR_PTRS_FROZEN_DIRTY,
+ SMALL_MUT_ARR_PTRS_FROZEN_CLEAN: {
+ W_ i_sarr, ptrs_sarr;
+ ptrs_sarr = StgSmallMutArrPtrs_ptrs(p);
+ if (ptrs_sarr == 0) { return (forced); }
+ i_sarr = ptrs_sarr - 1;
+ deepseq_arr_loop1:
+ if (i_sarr == 0) ( likely: False ) {
+ // Tail-call the final element to avoid building up a deep stack
+ // when traversing large immutable arrays.
+ jump stg_deepseqWorkzh(P_[p + SIZEOF_StgSmallMutArrPtrs], forced);
+ }
+ (W_ forced_sarr) = call stg_deepseqWorkzh(P_[p + SIZEOF_StgSmallMutArrPtrs + WDS(i_sarr)], forced);
+ forced = forced_sarr;
+ i_sarr = i_sarr - 1;
+ goto deepseq_arr_loop1;
+ }
+
+ // Constructors: evaluate their pointer fields.
+ case
+ CONSTR,
+ CONSTR_1_0,
+ CONSTR_0_1,
+ CONSTR_2_0,
+ CONSTR_1_1,
+ CONSTR_0_2,
+ CONSTR_NOCAF: {
+ W_ i_constr, ptrs_constr;
+ ptrs_constr = TO_W_(%INFO_PTRS(%STD_INFO(info)));
+ if (ptrs_constr == 0) { return (forced); }
+ i_constr = 0;
+ deepseq_constr_loop:
+ if (i_constr < ptrs_constr) {
+ // Tail-call the last one. This avoids building up a deep stack
+ // when traversing long lists. We count up so the final pointer
+ // field (e.g. the tail of a list cell) is tail-called.
+ if (i_constr == ptrs_constr - 1) {
+ jump stg_deepseqWorkzh(StgClosure_payload(p,i_constr), forced);
+ }
+ (W_ forced_constr) = call stg_deepseqWorkzh(StgClosure_payload(p,i_constr), forced);
+ forced = forced_constr;
+ i_constr = i_constr + 1;
+ goto deepseq_constr_loop;
+ }
+ return (forced);
+ }
+
+ case
+ MUT_VAR_CLEAN,
+ MUT_VAR_DIRTY: {
+ p = %relaxed StgMutVar_var(p);
+ jump stg_deepseqWorkzh(p, forced);
+ }
+
+ case
+ MVAR_CLEAN,
+ MVAR_DIRTY: {
+ p = %relaxed StgMVar_value(p);
+ jump stg_deepseqWorkzh(p, forced);
+ }
+
+ case TVAR: {
+ (P_ tvar_val) = call stg_readTVarIOzh(p);
+ jump stg_deepseqWorkzh(tvar_val, forced);
+ }
+
+ case WEAK: {
+ // Follow the value of a live weak pointer.
+ jump stg_deepseqWorkzh(StgWeak_value(p), forced);
+ }
+
+ // Anything else: conservatively stop.
+ //
+ // This includes (among other closure types) function-like closures and
+ // mutable objects which are not plain containers (e.g. TVar#),
+ // matching the intended "mimic typical NFData instances" semantics
+ // described in the primop documentation.
+ //
+ // We should never see frames here, but if we do, returning is safer than
+ // entering arbitrary things.
+ default: {
+ return (forced);
+ }}
+}
+
+// deepseq# primop entry point.
+// deepseq# :: forall a s. a -> State# s -> (# State# s, Int#, a #)
+//
+// The State# argument/result has no runtime representation, so the RTS entry
+// only takes the value being forced.
+stg_deepseqzh (P_ p)
+{
+ jump stg_deepseqLoopzh(p, 0);
+}
+
+// Worker which evaluates to a root and then delegates to the deep traversal.
+// The second argument is a boolean (0/1) accumulator tracking whether any
+// evaluation was forced in the transitive closure so far.
+stg_deepseqLoopzh (P_ p, W_ forced)
+{
+ W_ type, info, tag;
+
+ again: MAYBE_GC(again);
+ STK_CHK_GEN();
+
+ tag = GETTAG(p);
+ p = UNTAG(p);
+ info = %INFO_PTR(p);
+ type = TO_W_(%INFO_TYPE(%STD_INFO(info)));
+
+ switch [0 .. N_CLOSURE_TYPES] type {
+
+ // Unevaluated things must be evaluated first:
+ case
+ THUNK,
+ THUNK_1_0,
+ THUNK_0_1,
+ THUNK_2_0,
+ THUNK_1_1,
+ THUNK_0_2,
+ THUNK_STATIC,
+ AP,
+ AP_STACK,
+ BLACKHOLE,
+ THUNK_SELECTOR : {
+ (P_ evald) = call %ENTRY_CODE(info) (p);
+ jump stg_deepseqLoopzh(evald, 1);
+ }
+
+ // Follow indirections:
+ case IND, IND_STATIC: {
+ p = %acquire StgInd_indirectee(p);
+ jump stg_deepseqLoopzh(p, forced);
+ }
+
+ // WHITEHOLEs are transient. Yield and try again.
+ case WHITEHOLE: {
+ goto again;
+ }
+
+ default: {
+ P_ root;
+ root = tag | p;
+ (W_ forced1) = call stg_deepseqWorkzh(root, forced);
+ return (forced1, root);
+ }}
+}
=====================================
libraries/ghc-experimental/ghc-experimental.cabal.in
=====================================
@@ -31,6 +31,7 @@ library
exposed-modules:
Data.Sum.Experimental
Data.Tuple.Experimental
+ GHC.DeepSeq
GHC.PrimOps
GHC.Profiling.Eras
GHC.TypeLits.Experimental
@@ -46,4 +47,5 @@ library
build-depends: base >=4.20 && < 4.23,
ghc-internal == @ProjectVersionForLib@.*
hs-source-dirs: src
+ cmm-sources: cbits/DeepSeq.cmm
default-language: Haskell2010
=====================================
libraries/ghc-experimental/src/GHC/DeepSeq.hs
=====================================
@@ -0,0 +1,61 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE GHCForeignImportPrim #-}
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE UnboxedTuples #-}
+{-# LANGUAGE UnliftedFFITypes #-}
+
+module GHC.DeepSeq
+ ( force,
+ forceIO,
+ forceST,
+ )
+where
+
+import GHC.Internal.Exts
+import GHC.Internal.IO (stToIO)
+import GHC.Internal.ST (ST (..), runST)
+
+-- | Pure wrapper around 'forceST'.
+force :: a -> (Bool, a)
+force a = runST (forceST a)
+
+-- | Deeply evaluate a value in the 'IO' monad, returning the forced value and
+-- a flag indicating whether any unevaluated closure was forced.
+--
+-- This is a primitive analogue of 'Control.DeepSeq.force' / @rnf@ that does
+-- not require an 'NFData' constraint. It traverses algebraic data (constructor
+-- fields), immutable arrays, and the contents of 'MutVar#', 'MVar#',
+-- 'MutableArray#', 'SmallMutableArray#', 'TVar#', and live 'Weak#' values.
+--
+-- To mimic typical 'Control.DeepSeq.NFData' instances, it stops at
+-- function-like closures (e.g. functions and partial applications) and at
+-- mutable objects which are not plain containers (e.g. 'MutableByteArray#').
+-- Consequently
+-- it is not a drop-in replacement for user-defined 'NFData' instances, which
+-- may choose to force less (or more) depending on semantics.
+--
+-- === Pointer traversal policy
+--
+-- We only follow a pointer when doing so is also possible in Haskell via a
+-- corresponding API. For example, we traverse 'MutVar#', 'MVar#', mutable
+-- arrays, and live weak pointers because you can observe their contents with
+-- operations like @readIORef@, @readMVar@, @readArray@, or @deRefWeak@.
+-- Conversely, we do not peek inside closures whose internals are not
+-- observable from Haskell, such as function closures and their captured free
+-- variables.
+--
+-- Like any deep evaluation, it may not terminate on cyclic structures.
+forceIO :: a -> IO (Bool, a)
+forceIO a = stToIO (forceST a)
+
+-- | Deeply evaluate a value in the strict 'ST' monad.
+forceST :: a -> ST s (Bool, a)
+forceST a = ST $ \s0 -> case deepseq# a s0 of
+ (# s1, flag#, a' #) -> (# s1, (isTrue# flag#, a') #)
+
+foreign import prim "stg_deepseqzh" deepseqzh# :: Any -> State# s -> (# State# s, Int#, Any #)
+
+deepseq# :: a -> State# s -> (# State# s, Int#, a #)
+deepseq# x s0 =
+ case deepseqzh# (unsafeCoerce# x) s0 of
+ (# s1, flag#, x' #) -> (# s1, flag#, unsafeCoerce# x' #)
=====================================
testsuite/tests/interface-stability/ghc-experimental-exports.stdout
=====================================
@@ -4454,6 +4454,12 @@ module Data.Tuple.Experimental where
data Unit# = ...
getSolo :: forall a. Solo a -> a
+module GHC.DeepSeq where
+ -- Safety: None
+ force :: forall a. a -> (GHC.Internal.Types.Bool, a)
+ forceIO :: forall a. a -> GHC.Internal.Types.IO (GHC.Internal.Types.Bool, a)
+ forceST :: forall a s. a -> GHC.Internal.ST.ST s (GHC.Internal.Types.Bool, a)
+
module GHC.PrimOps where
-- Safety: Unsafe
(*#) :: Int# -> Int# -> Int#
=====================================
testsuite/tests/primops/should_run/DeepSeqPrimOp.hs
=====================================
@@ -0,0 +1,121 @@
+module Main (main) where
+
+import Control.Concurrent.MVar (MVar, newEmptyMVar, putMVar)
+import Control.Concurrent.STM (TVar, newTVarIO)
+import Control.Exception (SomeException, evaluate, try)
+import Data.Array (Array, listArray)
+import Data.Array.IO (IOArray, newArray)
+import Data.IORef (IORef, newIORef)
+import GHC.DeepSeq (force, forceIO, forceST)
+import GHC.Compact (compactWithSharing, getCompact)
+import GHC.ST (runST)
+import System.Mem.Weak (mkWeak)
+import System.Timeout (timeout)
+
+deepEvaluate :: a -> IO a
+deepEvaluate a = do
+ (_, a') <- forceIO a
+ pure a'
+
+deepEvaluateWithFlag :: a -> IO (Bool, a)
+deepEvaluateWithFlag = forceIO
+
+mkThunk :: Int -> Int
+mkThunk x = x + 1
+{-# NOINLINE mkThunk #-}
+
+boomVal :: Int
+boomVal = error "boom"
+{-# NOINLINE boomVal #-}
+
+funVal :: Int -> Int
+funVal _ = boomVal
+{-# NOINLINE funVal #-}
+
+main :: IO ()
+main = do
+ r1 <- try (deepEvaluate (1 :: Int, error "boom") >> pure ()) :: IO (Either SomeException ())
+ case r1 of
+ Left _ -> putStrLn "thunk-forced"
+ Right _ -> putStrLn "unexpected-no-exn"
+
+ r2 <- try (deepEvaluate funVal) :: IO (Either SomeException (Int -> Int))
+ case r2 of
+ Left _ -> putStrLn "unexpected-exn"
+ Right _ -> putStrLn "fun-ok"
+
+ (forced2, ()) <- deepEvaluateWithFlag ()
+ if not forced2
+ then putStrLn "noforce-ok"
+ else putStrLn "noforce-bad"
+
+ x <- evaluate (42 :: Int)
+ (forced2b, _) <- deepEvaluateWithFlag x
+ if not forced2b
+ then putStrLn "noforce-int-ok"
+ else putStrLn "noforce-int-bad"
+
+ let (forced2c, _) = force x
+ if not forced2c
+ then putStrLn "force-int-ok"
+ else putStrLn "force-int-bad"
+
+ let (forced2d, _) = runST (forceST x)
+ if not forced2d
+ then putStrLn "forcest-int-ok"
+ else putStrLn "forcest-int-bad"
+
+ let v = (1 :: Int, mkThunk 2)
+ (forced3, v') <- deepEvaluateWithFlag v
+ if forced3 && snd v' == 3
+ then putStrLn "thunk-ok"
+ else putStrLn "unexpected"
+
+ let arr :: Array Int Int
+ arr = listArray (0, 0) [boomVal]
+ r3 <- try (deepEvaluate arr >> pure ()) :: IO (Either SomeException ())
+ case r3 of
+ Left _ -> putStrLn "array-thunk-forced"
+ Right _ -> putStrLn "array-unforced"
+
+ ioArr <- newArray (0, 0) boomVal :: IO (IOArray Int Int)
+ r4 <- try (deepEvaluate ioArr >> pure ()) :: IO (Either SomeException ())
+ case r4 of
+ Left _ -> putStrLn "ioarray-thunk-forced"
+ Right _ -> putStrLn "ioarray-unforced"
+
+ ref <- newIORef boomVal :: IO (IORef Int)
+ r5 <- try (deepEvaluate ref >> pure ()) :: IO (Either SomeException ())
+ case r5 of
+ Left _ -> putStrLn "ioref-thunk-forced"
+ Right _ -> putStrLn "ioref-unforced"
+
+ mvar <- newEmptyMVar :: IO (MVar Int)
+ putMVar mvar boomVal
+ r6 <- try (deepEvaluate mvar >> pure ()) :: IO (Either SomeException ())
+ case r6 of
+ Left _ -> putStrLn "mvar-thunk-forced"
+ Right _ -> putStrLn "mvar-unforced"
+
+ tvar <- newTVarIO boomVal :: IO (TVar Int)
+ r6b <- try (deepEvaluate tvar >> pure ()) :: IO (Either SomeException ())
+ case r6b of
+ Left _ -> putStrLn "tvar-thunk-forced"
+ Right _ -> putStrLn "tvar-unforced"
+
+ keyRef <- newIORef ()
+ weak <- mkWeak keyRef boomVal Nothing
+ r7 <- try (deepEvaluate weak >> pure ()) :: IO (Either SomeException ())
+ case r7 of
+ Left _ -> putStrLn "weak-thunk-forced"
+ Right _ -> putStrLn "weak-unforced"
+
+ let cyclic :: [Int]
+ cyclic = let xs = 1 : xs in xs
+ compacted <- compactWithSharing cyclic
+ let cyclic' = getCompact compacted
+ _ <- evaluate cyclic'
+ r8 <- timeout 2000000 (deepEvaluateWithFlag cyclic')
+ case r8 of
+ Nothing -> putStrLn "compact-loop-timeout"
+ Just _ -> putStrLn "compact-loop-ok"
=====================================
testsuite/tests/primops/should_run/DeepSeqPrimOp.stdout
=====================================
@@ -0,0 +1,14 @@
+thunk-forced
+fun-ok
+noforce-ok
+noforce-int-ok
+force-int-ok
+forcest-int-ok
+thunk-ok
+array-thunk-forced
+ioarray-thunk-forced
+ioref-thunk-forced
+mvar-thunk-forced
+tvar-thunk-forced
+weak-thunk-forced
+compact-loop-ok
=====================================
testsuite/tests/primops/should_run/all.T
=====================================
@@ -17,6 +17,7 @@ test('T13825-compile', normal, compile_and_run, [''])
test('T16164', normal, compile_and_run, [''])
test('ShowPrim', normal, compile_and_run, [''])
test('T12492', normal, compile_and_run, [''])
+test('DeepSeqPrimOp', [js_skip, extra_ways(['ghci','ghci-opt']), extra_hc_opts('-package ghc-experimental -package ghc-compact')], compile_and_run, [''])
test('ArithInt8', normal, compile_and_run, [''])
test('ArithWord8', normal, compile_and_run, [''])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c1a8508d9d9cf3a2e3ffbdc33c459fb…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c1a8508d9d9cf3a2e3ffbdc33c459fb…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/fendor/gitignore-submodules] Remove blanket ignore that covers libraries/
by Hannes Siebenhandl (@fendor) 20 Jan '26
by Hannes Siebenhandl (@fendor) 20 Jan '26
20 Jan '26
Hannes Siebenhandl pushed to branch wip/fendor/gitignore-submodules at Glasgow Haskell Compiler / GHC
Commits:
332b5a73 by fendor at 2026-01-20T16:32:19+01:00
Remove blanket ignore that covers libraries/
- - - - -
1 changed file:
- .gitignore
Changes:
=====================================
.gitignore
=====================================
@@ -262,6 +262,5 @@ dist-newstyle/
# Windows CI
toolchain/
-ghc-*/
inplace/
tmp/
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/332b5a7322cac8425bdc965d322c47c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/332b5a7322cac8425bdc965d322c47c…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc] Pushed new branch wip/fendor/gitignore-submodules
by Hannes Siebenhandl (@fendor) 20 Jan '26
by Hannes Siebenhandl (@fendor) 20 Jan '26
20 Jan '26
Hannes Siebenhandl pushed new branch wip/fendor/gitignore-submodules at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/fendor/gitignore-submodules
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/fendor/freeze-throw] 3 commits: Regression tests for backtraces
by Hannes Siebenhandl (@fendor) 20 Jan '26
by Hannes Siebenhandl (@fendor) 20 Jan '26
20 Jan '26
Hannes Siebenhandl pushed to branch wip/fendor/freeze-throw at Glasgow Haskell Compiler / GHC
Commits:
43b811dc by fendor at 2026-01-20T16:03:18+01:00
Regression tests for backtraces
Document the stack traces of various exception throwing primitives.
- - - - -
747ce42d by fendor at 2026-01-20T16:15:25+01:00
Hide implementation details of `throw`
`throw` exposed implementation details as it doesn't freeze the
`CallStack`:
```
HasCallStack backtrace:
collectExceptionAnnotation, called at libraries/ghc-internal/src/GHC/Internal/Exception.hs:170:37 in ghc-internal:GHC.Internal.Exception
toExceptionWithBacktrace, called at libraries/ghc-internal/src/GHC/Internal/Exception.hs:90:42 in ghc-internal:GHC.Internal.Exception
throw, called at T26806b.hs:17:9 in main:Main
```
The functions `collectExceptionAnnotation` and `toExceptionWithBacktrace`
are implementation details of `throw` that are noise to the end user.
Thus, we freeze the `CallStack`, no longer exposing these details.
Then the backtrace looks like:
```
HasCallStack backtrace:
throw, called at T26806b.hs:17:9 in main:Main
```
- - - - -
721afc8e by fendor at 2026-01-20T16:17:49+01:00
Hide implementation details of `throwSTM`
`throwSTM` exposed implementation details as it doesn't freeze the
`CallStack`:
```
HasCallStack backtrace:
collectExceptionAnnotation, called at libraries/ghc-internal/src/GHC/Internal/Exception.hs:175:37 in ghc-internal:GHC.Internal.Exception
toExceptionWithBacktrace, called at libraries/ghc-internal/src/GHC/Internal/STM.hs:190:26 in ghc-internal:GHC.Internal.STM
throwSTM, called at T15395c.hs:8:5 in main:Main
```
The functions `collectExceptionAnnotation` and `toExceptionWithBacktrace`
are implementation details of `throwSTM` that are noise to the end user.
Thus, we freeze the `CallStack`, no longer exposing these details.
Then the backtrace looks like:
```
HasCallStack backtrace:
throwSTM, called at T15395c.hs:8:5 in main:Main
```
- - - - -
13 changed files:
- libraries/ghc-internal/src/GHC/Internal/Exception.hs
- libraries/ghc-internal/src/GHC/Internal/STM.hs
- + libraries/ghc-internal/tests/backtraces/T15395a.hs
- + libraries/ghc-internal/tests/backtraces/T15395a.stderr
- + libraries/ghc-internal/tests/backtraces/T15395b.hs
- + libraries/ghc-internal/tests/backtraces/T15395b.stderr
- + libraries/ghc-internal/tests/backtraces/T15395c.hs
- + libraries/ghc-internal/tests/backtraces/T15395c.stderr
- + libraries/ghc-internal/tests/backtraces/T15395d.hs
- + libraries/ghc-internal/tests/backtraces/T15395d.stderr
- + libraries/ghc-internal/tests/backtraces/T15395e.hs
- + libraries/ghc-internal/tests/backtraces/T15395e.stderr
- libraries/ghc-internal/tests/backtraces/all.T
Changes:
=====================================
libraries/ghc-internal/src/GHC/Internal/Exception.hs
=====================================
@@ -87,7 +87,7 @@ throw e =
-- Note also the absolutely crucial `noinine` in the RHS!
-- See Note [Hiding precise exception signature in throw]
let se :: SomeException
- !se = noinline (unsafePerformIO (toExceptionWithBacktrace e))
+ !se = noinline (unsafePerformIO (withFrozenCallStack $ toExceptionWithBacktrace e))
in raise# se
-- Note [Capturing the backtrace in throw]
@@ -162,7 +162,12 @@ throw e =
-- primops which allow more precise guidance of the demand analyser's heuristic
-- (e.g. #23847).
--- | @since base-4.20.0.0
+-- | Collect a Backtrace and attach it to the 'Exception'.
+--
+-- It is recommended to use 'withFrozenCallStack' when calling this function
+-- in order to avoid leaking implementation details of 'toExceptionWithBacktrace'.
+--
+-- @since base-4.20.0.0
toExceptionWithBacktrace :: (HasCallStack, Exception e)
=> e -> IO SomeException
toExceptionWithBacktrace e
=====================================
libraries/ghc-internal/src/GHC/Internal/STM.hs
=====================================
@@ -28,7 +28,7 @@ import GHC.Internal.Base
import GHC.Internal.Exception (Exception, toExceptionWithBacktrace, fromException, addExceptionContext)
import GHC.Internal.Exception.Context (ExceptionAnnotation)
import GHC.Internal.Exception.Type (WhileHandling(..))
-import GHC.Internal.Stack (HasCallStack)
+import GHC.Internal.Stack (HasCallStack, withFrozenCallStack)
-- TVars are shared memory locations which support atomic memory
-- transactions.
@@ -187,7 +187,7 @@ throwSTM e = do
-- N.B. Typically use of unsafeIOToSTM is very much frowned upon as this
-- is an easy way to end up with nested transactions. However, we can be
-- certain that toExceptionWithBacktrace will not initiate a transaction.
- se <- unsafeIOToSTM (toExceptionWithBacktrace e)
+ se <- unsafeIOToSTM (withFrozenCallStack $ toExceptionWithBacktrace e)
STM $ raiseIO# se
-- | Exception handling within STM actions.
=====================================
libraries/ghc-internal/tests/backtraces/T15395a.hs
=====================================
@@ -0,0 +1,5 @@
+import GHC.Internal.Control.Exception
+
+main :: IO ()
+main =
+ throw $ ErrorCall "throw error"
=====================================
libraries/ghc-internal/tests/backtraces/T15395a.stderr
=====================================
@@ -0,0 +1,7 @@
+T15395a: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:
+
+throw error
+
+HasCallStack backtrace:
+ throw, called at T15395a.hs:5:3 in main:Main
+
=====================================
libraries/ghc-internal/tests/backtraces/T15395b.hs
=====================================
@@ -0,0 +1,5 @@
+import GHC.Internal.Control.Exception
+
+main :: IO ()
+main =
+ throwIO $ ErrorCall "throwIO error"
=====================================
libraries/ghc-internal/tests/backtraces/T15395b.stderr
=====================================
@@ -0,0 +1,7 @@
+T15395b: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:
+
+throwIO error
+
+HasCallStack backtrace:
+ throwIO, called at T15395b.hs:5:3 in main:Main
+
=====================================
libraries/ghc-internal/tests/backtraces/T15395c.hs
=====================================
@@ -0,0 +1,8 @@
+
+import GHC.Internal.STM
+import GHC.Internal.Control.Exception
+
+main :: IO ()
+main =
+ atomically $ do
+ throwSTM $ ErrorCall "STM error"
=====================================
libraries/ghc-internal/tests/backtraces/T15395c.stderr
=====================================
@@ -0,0 +1,7 @@
+T15395c: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:
+
+STM error
+
+HasCallStack backtrace:
+ throwSTM, called at T15395c.hs:8:5 in main:Main
+
=====================================
libraries/ghc-internal/tests/backtraces/T15395d.hs
=====================================
@@ -0,0 +1,4 @@
+
+main :: IO ()
+main =
+ undefined
=====================================
libraries/ghc-internal/tests/backtraces/T15395d.stderr
=====================================
@@ -0,0 +1,7 @@
+T15395d: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:
+
+Prelude.undefined
+
+HasCallStack backtrace:
+ undefined, called at T15395d.hs:4:3 in main:Main
+
=====================================
libraries/ghc-internal/tests/backtraces/T15395e.hs
=====================================
@@ -0,0 +1,4 @@
+
+main :: IO ()
+main =
+ error "error"
=====================================
libraries/ghc-internal/tests/backtraces/T15395e.stderr
=====================================
@@ -0,0 +1,7 @@
+T15395e: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:
+
+error
+
+HasCallStack backtrace:
+ error, called at T15395e.hs:4:3 in main:Main
+
=====================================
libraries/ghc-internal/tests/backtraces/all.T
=====================================
@@ -1,6 +1,14 @@
+exc_opts = [ when(have_profiling(), extra_ways(['prof']))
+ , when(js_arch(), skip)
+ , exit_code(1)]
+
test('T14532a', [], compile_and_run, [''])
test('T14532b', [], compile_and_run, [''])
-test('T26507', [ when(have_profiling(), extra_ways(['prof']))
- , when(js_arch(), skip)
- , exit_code(1)], compile_and_run, [''])
+test('T26507', exc_opts, compile_and_run, [''])
+# Stack traces shouldn't expose implementation details
+test('T15395a', exc_opts, compile_and_run, [''])
+test('T15395b', exc_opts, compile_and_run, [''])
+test('T15395c', exc_opts, compile_and_run, [''])
+test('T15395d', exc_opts, compile_and_run, [''])
+test('T15395e', exc_opts, compile_and_run, [''])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/231ab0acd2d9854c25f3574edd4a1a…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/231ab0acd2d9854c25f3574edd4a1a…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/spj-apporv-Oct24] - Make a new variant `GeneratedSrcSpan` in `SrcSpan` for HIEAst Nodes
by Apoorv Ingle (@ani) 20 Jan '26
by Apoorv Ingle (@ani) 20 Jan '26
20 Jan '26
Apoorv Ingle pushed to branch wip/spj-apporv-Oct24 at Glasgow Haskell Compiler / GHC
Commits:
97246591 by Apoorv Ingle at 2026-01-20T08:52:06-06:00
- Make a new variant `GeneratedSrcSpan` in `SrcSpan` for HIEAst Nodes
- remove UnhelpfulGenerated from UnhelpfulSpanReason and into new datatype GeneratedSrcSpanDetails
- Fixes T23540, tcfail181
- - - - -
30 changed files:
- compiler/GHC.hs
- compiler/GHC/Hs/DocString.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Ext/Utils.hs
- compiler/GHC/Parser/HaddockLex.x
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Debugger/Breakpoints.hs
- compiler/GHC/Tc/Gen/Do.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Types/CtLoc.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Types/Error.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/GHC/Types/Name/Reader.hs
- compiler/GHC/Types/SrcLoc.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Logger.hs
- ghc/GHCi/UI.hs
- ghc/GHCi/UI/Info.hs
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Parsers.hs
- utils/check-exact/Transform.hs
- utils/check-exact/Utils.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs
Changes:
=====================================
compiler/GHC.hs
=====================================
@@ -288,7 +288,7 @@ module GHC (
SrcLoc(..), RealSrcLoc,
mkSrcLoc, noSrcLoc,
srcLocFile, srcLocLine, srcLocCol,
- SrcSpan(..), RealSrcSpan,
+ SrcSpan(..), RealSrcSpan, GeneratedSrcSpanDetails (..),
mkSrcSpan, srcLocSpan, isGoodSrcSpan, noSrcSpan,
srcSpanStart, srcSpanEnd,
srcSpanFile,
@@ -1617,6 +1617,7 @@ addSourceToTokens _ _ [] = []
addSourceToTokens loc buf (t@(L span _) : ts)
= case span of
UnhelpfulSpan _ -> (t,"") : addSourceToTokens loc buf ts
+ GeneratedSrcSpan _ -> (t,"") : addSourceToTokens loc buf ts
RealSrcSpan s _ -> (t,str) : addSourceToTokens newLoc newBuf ts
where
(newLoc, newBuf, str) = go "" loc buf
@@ -1637,12 +1638,14 @@ showRichTokenStream ts = go startLoc ts ""
where sourceFile = getFile $ map (getLoc . fst) ts
getFile [] = panic "showRichTokenStream: No source file found"
getFile (UnhelpfulSpan _ : xs) = getFile xs
+ getFile (GeneratedSrcSpan _ : xs) = getFile xs
getFile (RealSrcSpan s _ : _) = srcSpanFile s
startLoc = mkRealSrcLoc sourceFile 1 1
go _ [] = id
go loc ((L span _, str):ts)
= case span of
UnhelpfulSpan _ -> go loc ts
+ GeneratedSrcSpan _ -> go loc ts
RealSrcSpan s _
| locLine == tokLine -> ((replicate (tokCol - locCol) ' ') ++)
. (str ++)
=====================================
compiler/GHC/Hs/DocString.hs
=====================================
@@ -172,7 +172,7 @@ isEmptyDocString (GeneratedDocString x) = nullHDSC x
docStringChunks :: HsDocString -> [LHsDocStringChunk]
docStringChunks (MultiLineDocString _ (x:|xs)) = x:xs
docStringChunks (NestedDocString _ x) = [x]
-docStringChunks (GeneratedDocString x) = [L (UnhelpfulSpan UnhelpfulGenerated) x]
+docStringChunks (GeneratedDocString x) = [L (GeneratedSrcSpan UnhelpfulGenerated) x]
-- | Pretty print with decorators, exactly as the user wrote it
pprHsDocString :: HsDocString -> SDoc
=====================================
compiler/GHC/HsToCore/Monad.hs
=====================================
@@ -487,10 +487,10 @@ getSrcSpanDs = do { env <- getLclEnv
; return (RealSrcSpan (dsl_loc env) Strict.Nothing) }
putSrcSpanDs :: SrcSpan -> DsM a -> DsM a
-putSrcSpanDs (UnhelpfulSpan {}) thing_inside
- = thing_inside
putSrcSpanDs (RealSrcSpan real_span _) thing_inside
= updLclEnv (\ env -> env {dsl_loc = real_span}) thing_inside
+putSrcSpanDs _ thing_inside
+ = thing_inside
putSrcSpanDsA :: EpAnn ann -> DsM a -> DsM a
putSrcSpanDsA loc = putSrcSpanDs (locA loc)
=====================================
compiler/GHC/HsToCore/Ticks.hs
=====================================
@@ -121,7 +121,7 @@ addTicksToBinds logger cfg
, blackList = Set.fromList $
mapMaybe (\tyCon -> case getSrcSpan (tyConName tyCon) of
RealSrcSpan l _ -> Just l
- UnhelpfulSpan _ -> Nothing)
+ _ -> Nothing)
tyCons
, density = mkDensity tickish $ ticks_profAuto cfg
, this_mod = mod
@@ -1192,7 +1192,7 @@ getFileName = fileName `liftM` getEnv
isGoodSrcSpan' :: SrcSpan -> Bool
isGoodSrcSpan' pos@(RealSrcSpan _ _) = srcSpanStart pos /= srcSpanEnd pos
-isGoodSrcSpan' (UnhelpfulSpan _) = False
+isGoodSrcSpan' _ = False
isGoodTickSrcSpan :: SrcSpan -> TM Bool
isGoodTickSrcSpan pos = do
@@ -1218,11 +1218,11 @@ bindLocals from (TM m) = TM $ \env st ->
withBlackListed :: SrcSpan -> TM a -> TM a
withBlackListed (RealSrcSpan ss _) = withEnv (\ env -> env { blackList = Set.insert ss (blackList env) })
-withBlackListed (UnhelpfulSpan _) = id
+withBlackListed _ = id
isBlackListed :: SrcSpan -> TM Bool
isBlackListed (RealSrcSpan pos _) = TM $ \ env st -> (Set.member pos (blackList env), noFVs, st)
-isBlackListed (UnhelpfulSpan _) = return False
+isBlackListed _ = return False
-- the tick application inherits the source position of its
-- expression argument to support nested box allocations
=====================================
compiler/GHC/Iface/Ext/Ast.hs
=====================================
@@ -251,6 +251,11 @@ getUnlocatedEvBinds file = do
let node = Node (mkSourcedNodeInfo org ni) spn []
ni = NodeInfo mempty [] $ M.fromList [mkNodeInfo e]
in (xs,node:ys)
+ GeneratedSrcSpan (OrigSpan spn)
+ | srcSpanFile spn == file ->
+ let node = Node (mkSourcedNodeInfo org ni) spn []
+ ni = NodeInfo mempty [] $ M.fromList [mkNodeInfo e]
+ in (xs,node:ys)
_ -> (mkNodeInfo e : xs,ys)
(nis,asts) = foldr go ([],[]) elts
@@ -419,6 +424,7 @@ getRealSpanA la = getRealSpan (locA la)
getRealSpan :: SrcSpan -> Maybe Span
getRealSpan (RealSrcSpan sp _) = Just sp
+getRealSpan (GeneratedSrcSpan (OrigSpan sp)) = Just sp
getRealSpan _ = Nothing
grhss_span :: (Anno (GRHS (GhcPass p) (LocatedA (body (GhcPass p)))) ~ EpAnn NoEpAnns)
@@ -606,36 +612,39 @@ instance ToHie (Context (Located a)) => ToHie (Context (LocatedN a)) where
instance ToHie (Context (Located a)) => ToHie (Context (LocatedA a)) where
toHie (C c (L l a)) = toHie (C c (L (locA l) a))
-instance ToHie (Context (Located Var)) where
- toHie c = case c of
- C context (L (RealSrcSpan span _) name')
- | varUnique name' == mkBuiltinUnique 1 -> pure []
- -- `mkOneRecordSelector` makes a field var using this unique, which we ignore
- | otherwise -> do
- m <- lift $ gets name_remapping
- org <- ask
- let name = case lookupNameEnv m (varName name') of
- Just var -> var
- Nothing-> name'
- ty = case isDataConId_maybe name' of
+toHieCtxLocVar :: ContextInfo -> RealSrcSpan -> Var -> HieM [HieAST Type]
+toHieCtxLocVar context span name'
+ | varUnique name' == mkBuiltinUnique 1 = pure []
+ -- `mkOneRecordSelector` makes a field var using this unique, which we ignore
+ | otherwise = do
+ m <- lift $ gets name_remapping
+ org <- ask
+ let name = case lookupNameEnv m (varName name') of
+ Just var -> var
+ Nothing-> name'
+ ty = case isDataConId_maybe name' of
Nothing -> varType name'
Just dc -> dataConWrapperType dc
-- insert the entity info for the name into the entity_infos map
- insertEntityInfo (varName name) $ idEntityInfo name
- insertEntityInfo (varName name') $ idEntityInfo name'
- pure
- [Node
- (mkSourcedNodeInfo org $ NodeInfo S.empty [] $
- M.singleton (Right $ varName name)
+ insertEntityInfo (varName name) $ idEntityInfo name
+ insertEntityInfo (varName name') $ idEntityInfo name'
+ pure [Node (mkSourcedNodeInfo org $ NodeInfo S.empty [] $
+ M.singleton (Right $ varName name)
(IdentifierDetails (Just ty)
(S.singleton context)))
- span
- []]
+ span
+ []]
+
+instance ToHie (Context (Located Var)) where
+ toHie c = case c of
+ C context (L (RealSrcSpan span _) name') -> toHieCtxLocVar context span name'
+ C context (L (GeneratedSrcSpan (OrigSpan span)) name') -> toHieCtxLocVar context span name'
C (EvidenceVarBind i _ sp) (L _ name) -> do
addUnlocatedEvBind name (EvidenceVarBind i ModuleScope sp)
pure []
_ -> pure []
+
instance ToHie (Context (Located Name)) where
toHie c = case c of
C context (L (RealSrcSpan span _) name')
=====================================
compiler/GHC/Iface/Ext/Utils.hs
=====================================
@@ -322,6 +322,16 @@ getNameScopeAndBinding n asts = case nameSrcSpan n of
scopes <- maybeToList $ foldMap getScopeFromContext (identInfo dets)
let binding = foldMap (First . getBindSiteFromContext) (identInfo dets)
return $ Just (scopes, getFirst binding)
+ GeneratedSrcSpan (OrigSpan sp) -> do -- @Maybe
+ ast <- M.lookup (HiePath (srcSpanFile sp)) asts
+ defNode <- selectLargestContainedBy sp ast
+ getFirst $ foldMap First $ do -- @[]
+ node <- flattenAst defNode
+ dets <- maybeToList
+ $ M.lookup (Right n) $ sourcedNodeIdents $ sourcedNodeInfo node
+ scopes <- maybeToList $ foldMap getScopeFromContext (identInfo dets)
+ let binding = foldMap (First . getBindSiteFromContext) (identInfo dets)
+ return $ Just (scopes, getFirst binding)
_ -> Nothing
getScopeFromContext :: ContextInfo -> Maybe [Scope]
@@ -377,6 +387,7 @@ selectSmallestContaining sp node
definedInAsts :: M.Map HiePath (HieAST a) -> Name -> Bool
definedInAsts asts n = case nameSrcSpan n of
RealSrcSpan sp _ -> M.member (HiePath (srcSpanFile sp)) asts
+ GeneratedSrcSpan (OrigSpan sp) -> M.member (HiePath (srcSpanFile sp)) asts
_ -> False
getEvidenceBindDeps :: ContextInfo -> [Name]
@@ -527,6 +538,10 @@ locOnly (RealSrcSpan span _) = do
org <- ask
let e = mkSourcedNodeInfo org $ emptyNodeInfo
pure [Node e span []]
+locOnly (GeneratedSrcSpan (OrigSpan span)) = do
+ org <- ask
+ let e = mkSourcedNodeInfo org $ emptyNodeInfo
+ pure [Node e span []]
locOnly _ = pure []
locOnlyE :: Monad m => EpaLocation -> ReaderT NodeOrigin m [HieAST a]
@@ -536,6 +551,7 @@ locOnlyE _ = pure []
mkScope :: (HasLoc a) => a -> Scope
mkScope a = case getHasLoc a of
(RealSrcSpan sp _) -> LocalScope sp
+ (GeneratedSrcSpan (OrigSpan sp)) -> LocalScope sp
_ -> NoScope
combineScopes :: Scope -> Scope -> Scope
@@ -567,6 +583,7 @@ makeNode x spn = do
org <- ask
pure $ case spn of
RealSrcSpan span _ -> [Node (mkSourcedNodeInfo org $ simpleNodeInfo cons typ) span []]
+ GeneratedSrcSpan (OrigSpan span) -> [Node (mkSourcedNodeInfo org $ simpleNodeInfo cons typ) span []]
_ -> []
where
cons = mkFastString . show . toConstr $ x
@@ -593,6 +610,8 @@ makeTypeNode x spn etyp = do
pure $ case spn of
RealSrcSpan span _ ->
[Node (mkSourcedNodeInfo org $ NodeInfo (S.singleton (NodeAnnotation cons typ)) [etyp] M.empty) span []]
+ GeneratedSrcSpan (OrigSpan span) ->
+ [Node (mkSourcedNodeInfo org $ NodeInfo (S.singleton (NodeAnnotation cons typ)) [etyp] M.empty) span []]
_ -> []
where
cons = mkFastString . show . toConstr $ x
=====================================
compiler/GHC/Parser/HaddockLex.x
=====================================
@@ -145,6 +145,7 @@ lexStringLiteral identParser (L l sl@(StringLiteral _ fs _))
plausibleIdents = case l of
RealSrcSpan span _ -> [(RealSrcSpan span' Strict.Nothing, tok) | (span', tok) <- alexScanTokens (realSrcSpanStart span) bs]
UnhelpfulSpan reason -> [(UnhelpfulSpan reason, tok) | (_, tok) <- alexScanTokens fakeLoc bs]
+ GeneratedSrcSpan span -> [(GeneratedSrcSpan span, tok) | (_, tok) <- alexScanTokens fakeLoc bs]
fakeLoc = mkRealSrcLoc nilFS 0 0
@@ -166,6 +167,8 @@ lexHsDoc identParser doc =
= [(RealSrcSpan span' Strict.Nothing, tok) | (span', tok) <- alexScanTokens (realSrcSpanStart span) s]
plausibleIdents (L (UnhelpfulSpan reason) (HsDocStringChunk s))
= [(UnhelpfulSpan reason, tok) | (_, tok) <- alexScanTokens fakeLoc s] -- preserve the original reason
+ plausibleIdents (L (GeneratedSrcSpan span) (HsDocStringChunk s))
+ = [(GeneratedSrcSpan span, tok) | (_, tok) <- alexScanTokens fakeLoc s] -- preserve the original reason
fakeLoc = mkRealSrcLoc nilFS 0 0
@@ -181,11 +184,12 @@ validateIdentWith identParser mloc str0 =
buffer = stringBufferFromByteString str0
realSrcLc = case mloc of
RealSrcSpan loc _ -> realSrcSpanStart loc
+ GeneratedSrcSpan{} -> mkRealSrcLoc nilFS 0 0
UnhelpfulSpan _ -> mkRealSrcLoc nilFS 0 0
pstate = initParserState pflags buffer realSrcLc
in case unP identParser pstate of
POk _ name -> Just $ case mloc of
RealSrcSpan _ _ -> reLoc name
- UnhelpfulSpan _ -> L mloc (unLoc name) -- Preserve the original reason
+ _ -> L mloc (unLoc name) -- Preserve the original reason
_ -> Nothing
}
=====================================
compiler/GHC/Rename/Expr.hs
=====================================
@@ -502,11 +502,11 @@ rnExpr (ExplicitList _ exps)
then return (ExplicitList noExtField exps', fvs)
else
do { (from_list_n_name, fvs') <- lookupSyntaxName fromListNName
- --; loc <- getSrcSpanM -- See Note [Source locations for implicit function calls]
+ ; loc <- getSrcSpanM -- See Note [Source locations for implicit function calls]
; let rn_list = ExplicitList noExtField exps'
lit_n = mkIntegralLit (length exps)
hs_lit = genHsIntegralLit lit_n
- exp_list = genHsApps' (wrapGenSpan from_list_n_name) [hs_lit, wrapGenSpan rn_list]
+ exp_list = genHsApps' (wrapGenSpan' loc from_list_n_name) [hs_lit, wrapGenSpan rn_list]
; return ( mkExpandedExpr rn_list exp_list
, fvs `plusFV` fvs') } }
=====================================
compiler/GHC/Rename/Names.hs
=====================================
@@ -2166,7 +2166,7 @@ insertImportMap :: GlobalRdrElt -> ImportMap -> ImportMap
insertImportMap gre@(GRE { gre_imp = imp_specs }) importMap
| RealSrcSpan importSpan _ <- is_dloc best_imp_spec =
importMap{im_imports = insertElem importSpan gre $ im_imports importMap}
- | UnhelpfulSpan UnhelpfulGenerated <- is_dloc best_imp_spec =
+ | GeneratedSrcSpan{} <- is_dloc best_imp_spec =
importMap{im_generatedImports = insertElem (moduleName $ is_mod best_imp_spec) gre $ im_generatedImports importMap}
| otherwise = importMap
where
@@ -2187,7 +2187,7 @@ lookupImportMap (L srcSpan ImportDecl{ideclName = L _ modName}) importMap =
-- should match logic in insertImportMap
case locA srcSpan of
RealSrcSpan realSrcSpan _ -> realSrcSpan `Map.lookup` im_imports importMap
- UnhelpfulSpan UnhelpfulGenerated -> modName `Map.lookup` im_generatedImports importMap
+ GeneratedSrcSpan{} -> modName `Map.lookup` im_generatedImports importMap
_ -> Nothing
warnUnusedImport :: GlobalRdrEnv -> ImportDeclUsage -> RnM ()
@@ -2557,4 +2557,3 @@ addDupDeclErr gres@(gre :| _)
checkConName :: RdrName -> TcRn ()
checkConName name
= checkErr (isRdrDataCon name || isRdrTc name) (TcRnIllegalDataCon name)
-
=====================================
compiler/GHC/Rename/Utils.hs
=====================================
@@ -17,7 +17,7 @@ module GHC.Rename.Utils (
DeprecationWarnings(..), warnIfDeprecated,
checkUnusedRecordWildcard,
badQualBndrErr, typeAppErr, badFieldConErr,
- wrapGenSpan, wrapNoSpan, genHsVar, genLHsVar, genHsApp, genHsApps, genHsApps', genHsExpApps,
+ wrapGenSpan, wrapGenSpan', wrapNoSpan, genHsVar, genLHsVar, genHsApp, genHsApps, genHsApps', genHsExpApps,
genLHsApp, genAppType,
genLHsLit, genHsIntegralLit, genHsTyLit, genSimpleConPat,
genVarPat, genWildPat,
@@ -701,6 +701,11 @@ wrapGenSpan :: (HasAnnotation an) => a -> GenLocated an a
-- See Note [Rebindable syntax and XXExprGhcRn]
wrapGenSpan x = L (noAnnSrcSpan generatedSrcSpan) x
+wrapGenSpan' :: (HasAnnotation an) => SrcSpan -> a -> GenLocated an a
+wrapGenSpan' s x = case s of
+ RealSrcSpan s _ -> L (noAnnSrcSpan $ GeneratedSrcSpan (OrigSpan s)) x
+ _ -> wrapGenSpan x
+
wrapNoSpan :: (HasAnnotation an) => a -> GenLocated an a
-- Wrap something in a "noSrcSpan"
-- See Note [Rebindable syntax and XXExprGhcRn]
=====================================
compiler/GHC/Runtime/Debugger/Breakpoints.hs
=====================================
@@ -1,4 +1,3 @@
-
-- | GHC API debugger module for finding and setting breakpoints.
--
-- This module is user facing and is at least used by `GHCi` and `ghc-debugger`
@@ -86,6 +85,7 @@ leftmostLargestRealSrcSpan = on compare realSrcSpanStart S.<> on (flip compare)
-- | Returns the span of the largest tick containing the srcspan given
enclosingTickSpan :: TickArray -> SrcSpan -> RealSrcSpan
enclosingTickSpan _ (UnhelpfulSpan _) = panic "enclosingTickSpan UnhelpfulSpan"
+enclosingTickSpan _ (GeneratedSrcSpan _) = panic "generatedSrcSpan UnhelpfulSpan"
enclosingTickSpan ticks (RealSrcSpan src _) =
assert (inRange (bounds ticks) line) $
List.minimumBy leftmostLargestRealSrcSpan $ enclosing_spans
@@ -295,4 +295,3 @@ getCurrentBreakModule = do
return $ Just $ getBreakSourceMod ibi brks
ix ->
Just <$> getHistoryModule hug (resumeHistory r !! (ix-1))
-
=====================================
compiler/GHC/Tc/Gen/Do.hs
=====================================
@@ -123,7 +123,6 @@ expand_do_stmts doFlavour (stmt@(L loc (BodyStmt _ (L e_lspan e) (SyntaxExprRn t
do expand_stmts_expr <- expand_do_stmts doFlavour lstmts
let expansion = genHsExpApps then_op -- (>>)
[ L e_lspan (mkExpandedStmt stmt doFlavour e)
- -- wrapGenSpan e
, expand_stmts_expr ]
return $ L loc (mkExpandedStmt stmt doFlavour expansion)
=====================================
compiler/GHC/Tc/Gen/Expr.hs
=====================================
@@ -1359,7 +1359,7 @@ expandRecordUpd :: LHsExpr GhcRn
-- error context to push when typechecking
-- the expanded code
)
-expandRecordUpd record_expr possible_parents rbnds res_ty
+expandRecordUpd record_expr@(L lspan _) possible_parents rbnds res_ty
= do { -- STEP 0: typecheck the record_expr, the record to be updated.
--
-- Until GHC proposal #366 is implemented, we still use the type of
@@ -1527,7 +1527,7 @@ expandRecordUpd record_expr possible_parents rbnds res_ty
ds_expr = HsLet noExtField let_binds (wrapGenSpan case_expr)
case_expr :: HsExpr GhcRn
- case_expr = HsCase RecUpd (wrapGenSpan (unLoc record_expr))
+ case_expr = HsCase RecUpd (wrapGenSpan' (locA lspan) (unLoc record_expr))
$ mkMatchGroup (Generated OtherExpansion DoPmc) (wrapGenSpan matches)
matches :: [LMatch GhcRn (LHsExpr GhcRn)]
matches = map make_pat (NE.toList relevant_cons)
=====================================
compiler/GHC/Tc/Gen/Splice.hs
=====================================
@@ -1480,9 +1480,11 @@ instance TH.Quasi TcM where
qLocation = do { m <- getModule
; l <- getSrcSpanM
; r <- case l of
+ RealSrcSpan s _ -> return s
+ GeneratedSrcSpan l -> pprPanic "qLocation: generatedSrcSpan"
+ (pprGeneratedSrcSpanDetails l)
UnhelpfulSpan _ -> pprPanic "qLocation: Unhelpful location"
(ppr l)
- RealSrcSpan s _ -> return s
; return (TH.Loc { TH.loc_filename = unpackFS (srcSpanFile r)
, TH.loc_module = moduleNameString (moduleName m)
, TH.loc_package = unitString (moduleUnit m)
=====================================
compiler/GHC/Tc/Types/CtLoc.hs
=====================================
@@ -257,8 +257,7 @@ setCtLocEnvLoc :: CtLocEnv -> SrcSpan -> CtLocEnv
-- for the ctl_in_gen_code manipulation
setCtLocEnvLoc env (RealSrcSpan loc _)
= env { ctl_loc = loc, ctl_in_gen_code = False }
-
-setCtLocEnvLoc env loc@(UnhelpfulSpan _)
+setCtLocEnvLoc env loc
| isGeneratedSrcSpan loc
= env { ctl_in_gen_code = True }
| otherwise
=====================================
compiler/GHC/Tc/Utils/Monad.hs
=====================================
@@ -62,7 +62,7 @@ module GHC.Tc.Utils.Monad(
-- * Error management
getSrcCodeOrigin,
- getSrcSpanM, setSrcSpan, setSrcSpanA, addLocM,
+ getSrcSpanM, getRealSrcSpanM, setSrcSpan, setSrcSpanA, addLocM,
inGeneratedCode,
wrapLocM, wrapLocFstM, wrapLocFstMA, wrapLocSndM, wrapLocSndMA, wrapLocM_,
wrapLocMA_,wrapLocMA,
@@ -1070,6 +1070,11 @@ getSrcSpanM :: TcRn SrcSpan
-- Avoid clash with Name.getSrcLoc
getSrcSpanM = do { env <- getLclEnv; return (RealSrcSpan (getLclEnvLoc env) Strict.Nothing) }
+getRealSrcSpanM :: TcRn RealSrcSpan
+ -- Avoid clash with Name.getSrcLoc
+getRealSrcSpanM = do { env <- getLclEnv; return $ getLclEnvLoc env }
+
+
-- See Note [Error contexts in generated code]
inGeneratedCode :: TcRn Bool
inGeneratedCode = lclEnvInGeneratedCode <$> getLclEnv
=====================================
compiler/GHC/Types/Error.hs
=====================================
@@ -787,7 +787,6 @@ getSeverityColour severity = case severity of
SevIgnore -> const mempty
getCaretDiagnostic :: MessageClass -> SrcSpan -> IO SDoc
-getCaretDiagnostic _ (UnhelpfulSpan _) = pure empty
getCaretDiagnostic msg_class (RealSrcSpan span _) =
caretDiagnostic <$> getSrcLine (srcSpanFile span) row
where
@@ -861,7 +860,7 @@ getCaretDiagnostic msg_class (RealSrcSpan span _) =
caretEllipsis | multiline = "..."
| otherwise = ""
caretLine = replicate start ' ' ++ replicate width '^' ++ caretEllipsis
-
+getCaretDiagnostic _ _ = pure empty
--
-- Queries
--
=====================================
compiler/GHC/Types/Hint/Ppr.hs
=====================================
@@ -19,7 +19,7 @@ import GHC.Hs.Expr () -- instance Outputable
import GHC.Types.Id
import GHC.Types.Name
import GHC.Types.Name.Reader (RdrName,ImpDeclSpec (..), rdrNameOcc, rdrNameSpace)
-import GHC.Types.SrcLoc (SrcSpan(..), srcSpanStartLine)
+import GHC.Types.SrcLoc (SrcSpan(..), srcSpanStartLine, UnhelpfulSpanReason(..), pprGeneratedSrcSpanDetails)
import GHC.Unit.Module.Imported (ImportedModsVal(..))
import GHC.Unit.Types
import GHC.Utils.Outputable
@@ -424,6 +424,7 @@ pprSimilarName mb_tried_ns (SimilarRdrName rdr_name _gre_info how_in_scope)
LocallyBoundAt loc ->
case loc of
UnhelpfulSpan l -> parens (ppr l)
+ GeneratedSrcSpan ss -> parens (pprGeneratedSrcSpanDetails ss)
RealSrcSpan l _ -> parens (text "line" <+> int (srcSpanStartLine l))
ImportedBy is ->
parens (text "imported from" <+> ppr (moduleName $ is_mod is))
=====================================
compiler/GHC/Types/Name/Reader.hs
=====================================
@@ -2077,9 +2077,12 @@ bestImport iss = NE.head $ NE.sortBy best iss
-- False < True, so if e1 is explicit and e2 is not, we get GT
compareGenerated UnhelpfulSpan{} UnhelpfulSpan{} = EQ
- compareGenerated UnhelpfulSpan{} RealSrcSpan{} = LT
- compareGenerated RealSrcSpan{} UnhelpfulSpan{} = GT
+ compareGenerated UnhelpfulSpan{} _ = LT
+ compareGenerated GeneratedSrcSpan{} UnhelpfulSpan{} = GT
+ compareGenerated GeneratedSrcSpan{} GeneratedSrcSpan{} = EQ
+ compareGenerated GeneratedSrcSpan{} _ = LT
compareGenerated RealSrcSpan{} RealSrcSpan{} = EQ
+ compareGenerated RealSrcSpan{} _ = GT
{- Note [Choosing the best import declaration]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2212,6 +2215,7 @@ instance Outputable ImportSpec where
pprLoc :: SrcSpan -> SDoc
pprLoc (RealSrcSpan s _) = text "at" <+> ppr s
pprLoc (UnhelpfulSpan {}) = empty
+pprLoc (GeneratedSrcSpan {}) = empty
-- | Indicate if the given name is the "@" operator
opIsAt :: RdrName -> Bool
=====================================
compiler/GHC/Types/SrcLoc.hs
=====================================
@@ -30,6 +30,7 @@ module GHC.Types.SrcLoc (
-- * SrcSpan
RealSrcSpan, -- Abstract
SrcSpan(..),
+ GeneratedSrcSpanDetails(..),
UnhelpfulSpanReason(..),
-- ** Constructing SrcSpan
@@ -49,6 +50,8 @@ module GHC.Types.SrcLoc (
pprUserSpan,
unhelpfulSpanFS,
srcSpanToRealSrcSpan,
+ pprGeneratedSrcSpanDetails,
+ generatedSrcSpanDetailsFS,
-- ** Unsafely deconstructing SrcSpan
-- These are dubious exports, because they crash on some inputs
@@ -306,7 +309,7 @@ lookupSrcLoc (UnhelpfulLoc _) = const Nothing
lookupSrcSpan :: SrcSpan -> Map.Map RealSrcSpan a -> Maybe a
lookupSrcSpan (RealSrcSpan l _) = Map.lookup l
-lookupSrcSpan (UnhelpfulSpan _) = const Nothing
+lookupSrcSpan _ = const Nothing
instance Outputable RealSrcLoc where
ppr (SrcLoc (LexicalFastString src_path) src_line src_col)
@@ -387,16 +390,22 @@ instance Semigroup BufSpan where
-- or a human-readable description of a location.
data SrcSpan =
RealSrcSpan !RealSrcSpan !(Strict.Maybe BufSpan) -- See Note [Why Maybe BufPos]
+ | GeneratedSrcSpan !GeneratedSrcSpanDetails
| UnhelpfulSpan !UnhelpfulSpanReason
deriving (Eq, Show) -- Show is used by GHC.Parser.Lexer, because we
-- derive Show for Token
+-- Needed for HIE
+data GeneratedSrcSpanDetails =
+ OrigSpan !RealSrcSpan -- this the span of the user written thing
+ | UnhelpfulGenerated
+ deriving (Eq, Show)
+
data UnhelpfulSpanReason
= UnhelpfulNoLocationInfo
| UnhelpfulWiredIn
| UnhelpfulInteractive
- | UnhelpfulGenerated
| UnhelpfulOther !FastString
deriving (Eq, Show)
@@ -426,8 +435,13 @@ messages, constructing a SrcSpan without a BufSpan.
instance ToJson SrcSpan where
json (UnhelpfulSpan {} ) = JSNull --JSObject [( "type", "unhelpful")]
+ json (GeneratedSrcSpan d) = json d
json (RealSrcSpan rss _) = json rss
+instance ToJson GeneratedSrcSpanDetails where
+ json (UnhelpfulGenerated) = JSNull
+ json (OrigSpan s) = json s
+
instance ToJson RealSrcSpan where
json (RealSrcSpan'{..}) = JSObject [ ("file", JSString (unpackFS srcSpanFile)),
("start", start),
@@ -444,27 +458,32 @@ instance NFData RealSrcSpan where
instance NFData SrcSpan where
rnf (RealSrcSpan a1 a2) = rnf a1 `seq` rnf a2
rnf (UnhelpfulSpan a1) = rnf a1
+ rnf (GeneratedSrcSpan a1) = rnf a1
+
+instance NFData GeneratedSrcSpanDetails where
+ rnf (OrigSpan s) = rnf s
+ rnf (UnhelpfulGenerated) = ()
instance NFData UnhelpfulSpanReason where
rnf (UnhelpfulNoLocationInfo) = ()
rnf (UnhelpfulWiredIn) = ()
rnf (UnhelpfulInteractive) = ()
- rnf (UnhelpfulGenerated) = ()
rnf (UnhelpfulOther a1) = rnf a1
getBufSpan :: SrcSpan -> Strict.Maybe BufSpan
getBufSpan (RealSrcSpan _ mbspan) = mbspan
-getBufSpan (UnhelpfulSpan _) = Strict.Nothing
+getBufSpan _ = Strict.Nothing
+
-- | Built-in "bad" 'SrcSpan's for common sources of location uncertainty
noSrcSpan, generatedSrcSpan, wiredInSrcSpan, interactiveSrcSpan :: SrcSpan
noSrcSpan = UnhelpfulSpan UnhelpfulNoLocationInfo
wiredInSrcSpan = UnhelpfulSpan UnhelpfulWiredIn
interactiveSrcSpan = UnhelpfulSpan UnhelpfulInteractive
-generatedSrcSpan = UnhelpfulSpan UnhelpfulGenerated
+generatedSrcSpan = GeneratedSrcSpan UnhelpfulGenerated
isGeneratedSrcSpan :: SrcSpan -> Bool
-isGeneratedSrcSpan (UnhelpfulSpan UnhelpfulGenerated) = True
+isGeneratedSrcSpan (GeneratedSrcSpan{}) = True
isGeneratedSrcSpan _ = False
isNoSrcSpan :: SrcSpan -> Bool
@@ -515,6 +534,8 @@ mkSrcSpan (RealSrcLoc loc1 mbpos1) (RealSrcLoc loc2 mbpos2)
combineSrcSpans :: SrcSpan -> SrcSpan -> SrcSpan
combineSrcSpans (UnhelpfulSpan _) r = r -- this seems more useful
combineSrcSpans l (UnhelpfulSpan _) = l
+combineSrcSpans (GeneratedSrcSpan{}) r = r
+combineSrcSpans l (GeneratedSrcSpan{}) = l
combineSrcSpans (RealSrcSpan span1 mbspan1) (RealSrcSpan span2 mbspan2)
| srcSpanFile span1 == srcSpanFile span2
= RealSrcSpan (combineRealSrcSpans span1 span2) (liftA2 combineBufSpans mbspan1 mbspan2)
@@ -543,6 +564,7 @@ combineBufSpans span1 span2 = BufSpan start end
-- | Convert a SrcSpan into one that represents only its first character
srcSpanFirstCharacter :: SrcSpan -> SrcSpan
srcSpanFirstCharacter l@(UnhelpfulSpan {}) = l
+srcSpanFirstCharacter l@(GeneratedSrcSpan {}) = l
srcSpanFirstCharacter (RealSrcSpan span mbspan) =
RealSrcSpan (mkRealSrcSpan loc1 loc2) (fmap mkBufSpan mbspan)
where
@@ -564,13 +586,13 @@ srcSpanFirstCharacter (RealSrcSpan span mbspan) =
-- | Test if a 'SrcSpan' is "good", i.e. has precise location information
isGoodSrcSpan :: SrcSpan -> Bool
isGoodSrcSpan (RealSrcSpan _ _) = True
-isGoodSrcSpan (UnhelpfulSpan _) = False
+isGoodSrcSpan _ = False
isOneLineSpan :: SrcSpan -> Bool
-- ^ True if the span is known to straddle only one line.
-- For "bad" 'SrcSpan', it returns False
isOneLineSpan (RealSrcSpan s _) = srcSpanStartLine s == srcSpanEndLine s
-isOneLineSpan (UnhelpfulSpan _) = False
+isOneLineSpan _ = False
isZeroWidthSpan :: SrcSpan -> Bool
-- ^ True if the span has a width of zero, as returned for "virtual"
@@ -578,7 +600,7 @@ isZeroWidthSpan :: SrcSpan -> Bool
-- For "bad" 'SrcSpan', it returns False
isZeroWidthSpan (RealSrcSpan s _) = srcSpanStartLine s == srcSpanEndLine s
&& srcSpanStartCol s == srcSpanEndCol s
-isZeroWidthSpan (UnhelpfulSpan _) = False
+isZeroWidthSpan _ = False
-- | Tests whether the first span "contains" the other span, meaning
-- that it covers at least as much source code. True where spans are equal.
@@ -620,11 +642,13 @@ srcSpanEndCol RealSrcSpan'{ srcSpanECol=c } = c
-- | Returns the location at the start of the 'SrcSpan' or a "bad" 'SrcSpan' if that is unavailable
srcSpanStart :: SrcSpan -> SrcLoc
srcSpanStart (UnhelpfulSpan r) = UnhelpfulLoc (unhelpfulSpanFS r)
+srcSpanStart (GeneratedSrcSpan d) = UnhelpfulLoc (generatedSrcSpanDetailsFS d)
srcSpanStart (RealSrcSpan s b) = RealSrcLoc (realSrcSpanStart s) (fmap bufSpanStart b)
-- | Returns the location at the end of the 'SrcSpan' or a "bad" 'SrcSpan' if that is unavailable
srcSpanEnd :: SrcSpan -> SrcLoc
srcSpanEnd (UnhelpfulSpan r) = UnhelpfulLoc (unhelpfulSpanFS r)
+srcSpanEnd (GeneratedSrcSpan d) = UnhelpfulLoc (generatedSrcSpanDetailsFS d)
srcSpanEnd (RealSrcSpan s b) = RealSrcLoc (realSrcSpanEnd s) (fmap bufSpanEnd b)
realSrcSpanStart :: RealSrcSpan -> RealSrcLoc
@@ -640,7 +664,7 @@ realSrcSpanEnd s = mkRealSrcLoc (srcSpanFile s)
-- | Obtains the filename for a 'SrcSpan' if it is "good"
srcSpanFileName_maybe :: SrcSpan -> Maybe FastString
srcSpanFileName_maybe (RealSrcSpan s _) = Just (srcSpanFile s)
-srcSpanFileName_maybe (UnhelpfulSpan _) = Nothing
+srcSpanFileName_maybe _ = Nothing
srcSpanToRealSrcSpan :: SrcSpan -> Maybe RealSrcSpan
srcSpanToRealSrcSpan (RealSrcSpan ss _) = Just ss
@@ -710,13 +734,19 @@ unhelpfulSpanFS r = case r of
UnhelpfulNoLocationInfo -> fsLit "<no location info>"
UnhelpfulWiredIn -> fsLit "<wired into compiler>"
UnhelpfulInteractive -> fsLit "<interactive>"
- UnhelpfulGenerated -> fsLit "<generated>"
pprUnhelpfulSpanReason :: UnhelpfulSpanReason -> SDoc
pprUnhelpfulSpanReason r = ftext (unhelpfulSpanFS r)
+generatedSrcSpanDetailsFS :: GeneratedSrcSpanDetails -> FastString
+generatedSrcSpanDetailsFS _ = fsLit "<generated>"
+
+pprGeneratedSrcSpanDetails :: GeneratedSrcSpanDetails -> SDoc
+pprGeneratedSrcSpanDetails d = ftext (generatedSrcSpanDetailsFS d)
+
pprUserSpan :: Bool -> SrcSpan -> SDoc
pprUserSpan _ (UnhelpfulSpan r) = pprUnhelpfulSpanReason r
+pprUserSpan _ (GeneratedSrcSpan d) = pprGeneratedSrcSpanDetails d
pprUserSpan show_path (RealSrcSpan s _) = pprUserRealSpan show_path s
pprUserRealSpan :: Bool -> RealSrcSpan -> SDoc
@@ -843,15 +873,19 @@ leftmost_largest = compareSrcSpanBy $
compareSrcSpanBy :: (RealSrcSpan -> RealSrcSpan -> Ordering) -> SrcSpan -> SrcSpan -> Ordering
compareSrcSpanBy cmp (RealSrcSpan a _) (RealSrcSpan b _) = cmp a b
-compareSrcSpanBy _ (RealSrcSpan _ _) (UnhelpfulSpan _) = LT
+compareSrcSpanBy _ (RealSrcSpan _ _) _ = LT
compareSrcSpanBy _ (UnhelpfulSpan _) (RealSrcSpan _ _) = GT
-compareSrcSpanBy _ (UnhelpfulSpan _) (UnhelpfulSpan _) = EQ
+compareSrcSpanBy _ (UnhelpfulSpan _) _ = EQ
+compareSrcSpanBy _ (GeneratedSrcSpan _) (RealSrcSpan _ _) = GT
+compareSrcSpanBy _ (GeneratedSrcSpan _) _ = EQ
+
-- | Determines whether a span encloses a given line and column index
spans :: SrcSpan -> (Int, Int) -> Bool
-spans (UnhelpfulSpan _) _ = panic "spans UnhelpfulSpan"
spans (RealSrcSpan span _) (l,c) = realSrcSpanStart span <= loc && loc <= realSrcSpanEnd span
where loc = mkRealSrcLoc (srcSpanFile span) l c
+spans (UnhelpfulSpan _) _ = panic "spans UnhelpfulSpan"
+spans (GeneratedSrcSpan _) _ = panic "spans GeneratedSrcSpan"
-- | Determines whether a span is enclosed by another one
isSubspanOf :: SrcSpan -- ^ The span that may be enclosed by the other
=====================================
compiler/GHC/Utils/Binary.hs
=====================================
@@ -1912,8 +1912,7 @@ instance Binary UnhelpfulSpanReason where
UnhelpfulNoLocationInfo -> putByte bh 0
UnhelpfulWiredIn -> putByte bh 1
UnhelpfulInteractive -> putByte bh 2
- UnhelpfulGenerated -> putByte bh 3
- UnhelpfulOther fs -> putByte bh 4 >> put_ bh fs
+ UnhelpfulOther fs -> putByte bh 3 >> put_ bh fs
get bh = do
h <- getByte bh
@@ -1921,11 +1920,25 @@ instance Binary UnhelpfulSpanReason where
0 -> return UnhelpfulNoLocationInfo
1 -> return UnhelpfulWiredIn
2 -> return UnhelpfulInteractive
- 3 -> return UnhelpfulGenerated
_ -> UnhelpfulOther <$> get bh
newtype BinSrcSpan = BinSrcSpan { unBinSrcSpan :: SrcSpan }
+instance Binary GeneratedSrcSpanDetails where
+ put_ bh (OrigSpan ss) = do
+ putByte bh 0
+ put_ bh $ BinSpan ss
+
+ put_ bh UnhelpfulGenerated = do
+ putByte bh 1
+
+ get bh = do
+ h <- getByte bh
+ case h of
+ 0 -> do BinSpan ss <- get bh
+ return $ OrigSpan ss
+ _ -> do return UnhelpfulGenerated
+
-- See Note [Source Location Wrappers]
instance Binary BinSrcSpan where
put_ bh (BinSrcSpan (RealSrcSpan ss _sb)) = do
@@ -1938,13 +1951,19 @@ instance Binary BinSrcSpan where
putByte bh 1
put_ bh s
+ put_ bh (BinSrcSpan (GeneratedSrcSpan ss)) = do
+ putByte bh 2
+ put_ bh ss
+
get bh = do
h <- getByte bh
case h of
0 -> do BinSpan ss <- get bh
return $ BinSrcSpan (RealSrcSpan ss Strict.Nothing)
- _ -> do s <- get bh
+ 1 -> do s <- get bh
return $ BinSrcSpan (UnhelpfulSpan s)
+ _ -> do ss <- get bh
+ return $ BinSrcSpan (GeneratedSrcSpan ss)
{-
=====================================
compiler/GHC/Utils/Logger.hs
=====================================
@@ -398,7 +398,7 @@ jsonLogActionWithHandle out logflags msg_class srcSpan msg
, ("endCol", json $ srcSpanEndCol rss)
]
where file = unpackFS $ srcSpanFile rss
- UnhelpfulSpan _ -> JSNull
+ _ -> JSNull
-- | The default 'LogAction' prints to 'stdout' and 'stderr'.
--
@@ -707,4 +707,3 @@ class HasLogger m where
class ContainsLogger t where
extractLogger :: t -> Logger
-
=====================================
ghc/GHCi/UI.hs
=====================================
@@ -2692,8 +2692,9 @@ parseSpanArg s = do
-- @<filename>:(<line>,<col>)-(<line-end>,<col-end>)@
-- while simply unpacking 'UnhelpfulSpan's
showSrcSpan :: SrcSpan -> String
-showSrcSpan (UnhelpfulSpan s) = unpackFS (unhelpfulSpanFS s)
-showSrcSpan (RealSrcSpan spn _) = showRealSrcSpan spn
+showSrcSpan (UnhelpfulSpan s) = unpackFS (unhelpfulSpanFS s)
+showSrcSpan (GeneratedSrcSpan d) = unpackFS (generatedSrcSpanDetailsFS d)
+showSrcSpan (RealSrcSpan spn _) = showRealSrcSpan spn
-- | Variant of 'showSrcSpan' for 'RealSrcSpan's
showRealSrcSpan :: RealSrcSpan -> String
@@ -4235,14 +4236,14 @@ stepLocalCmd arg = withSandboxOnly ":steplocal" $ step arg
mb_span <- getCurrentBreakSpan
case mb_span of
Nothing -> stepCmd []
- Just (UnhelpfulSpan _) -> liftIO $ putStrLn ( -- #14690
- ":steplocal is not possible." ++
- "\nCannot determine current top-level binding after " ++
- "a break on error / exception.\nUse :stepmodule.")
- Just loc -> do
+ Just loc@(RealSrcSpan{}) -> do
md <- fromMaybe (panic "stepLocalCmd") <$> getCurrentBreakModule
current_toplevel_decl <- flip enclosingTickSpan loc <$> getTickArray md
doContinue (GHC.LocalStep (RealSrcSpan current_toplevel_decl Strict.Nothing))
+ Just _ -> liftIO $ putStrLn ( -- #14690
+ ":steplocal is not possible." ++
+ "\nCannot determine current top-level binding after " ++
+ "a break on error / exception.\nUse :stepmodule.")
stepModuleCmd :: GhciMonad m => String -> m ()
stepModuleCmd arg = withSandboxOnly ":stepmodule" $ step arg
@@ -4580,7 +4581,7 @@ listCmd "" = do
printForUser $ text "Not stopped at a breakpoint; nothing to list"
Just (RealSrcSpan pan _) ->
listAround pan True
- Just pan@(UnhelpfulSpan _) ->
+ Just pan@_ ->
do resumes <- GHC.getResumeContext
case resumes of
[] -> panic "No resumes"
=====================================
ghc/GHCi/UI/Info.hs
=====================================
@@ -168,6 +168,7 @@ findName infos span0 mi string =
Just name ->
case getSrcSpan name of
UnhelpfulSpan {} -> tryExternalModuleResolution
+ GeneratedSrcSpan {} -> tryExternalModuleResolution
RealSrcSpan {} -> return (getName name)
where
rdrs = modInfo_rdrs mi
=====================================
utils/check-exact/ExactPrint.hs
=====================================
@@ -481,6 +481,7 @@ enterAnn !(Entry anchor' trailing_anns cs flush canUpdateAnchor) a = do
dp = adjustDeltaForOffset
off (ss2delta priorEndAfterComments r)
Just (EpaSpan (UnhelpfulSpan r)) -> panic $ "enterAnn: UnhelpfulSpan:" ++ show r
+ Just (EpaSpan (GeneratedSrcSpan r)) -> panic $ "enterAnn: UnhelpfulSpan:" ++ show r
when (isJust med) $ debugM $ "enterAnn:(med,edp)=" ++ showAst (med,edp)
when (isJust medr) $ setExtraDPReturn medr
-- ---------------------------------------------
@@ -741,7 +742,7 @@ printStringAtNC el str = do
printStringAtAAC :: (Monad m, Monoid w)
=> CaptureComments -> EpaLocation -> String -> EP w m EpaLocation
printStringAtAAC capture (EpaSpan (RealSrcSpan r _)) s = printStringAtRsC capture r s
-printStringAtAAC _capture (EpaSpan ss@(UnhelpfulSpan _)) _s = error $ "printStringAtAAC:ss=" ++ show ss
+printStringAtAAC _capture (EpaSpan ss) _s = error $ "printStringAtAAC:ss=" ++ show ss
printStringAtAAC capture (EpaDelta ss d cs) s = do
mapM_ printOneComment $ concatMap tokComment cs
pe1 <- getPriorEndD
@@ -1360,7 +1361,7 @@ printOneComment c@(Comment _str loc _r _mo) = do
let dp = ss2delta pe r
debugM $ "printOneComment:(dp,pe,loc)=" ++ showGhc (dp,pe,loc)
adjustDeltaForOffsetM dp
- EpaSpan (UnhelpfulSpan _) -> return (SameLine 0)
+ EpaSpan _ -> return (SameLine 0)
mep <- getExtraDP
dp' <- case mep of
Just (EpaDelta _ edp _) -> do
=====================================
utils/check-exact/Parsers.hs
=====================================
@@ -305,8 +305,6 @@ fixModuleHeaderComments (GHC.L l p) = GHC.L l p'
where
moveComments :: GHC.EpaLocation -> GHC.LHsDecl GHC.GhcPs -> GHC.EpAnnComments
-> (GHC.LHsDecl GHC.GhcPs, GHC.EpAnnComments)
- moveComments GHC.EpaDelta{} dd cs = (dd,cs)
- moveComments (GHC.EpaSpan (GHC.UnhelpfulSpan _)) dd cs = (dd,cs)
moveComments (GHC.EpaSpan (GHC.RealSrcSpan r _)) (GHC.L (GHC.EpAnn anc an csd) a) cs = (dd,css)
where
-- Move any comments on the decl that occur prior to the location
@@ -318,12 +316,14 @@ fixModuleHeaderComments (GHC.L l p) = GHC.L l p'
dd = GHC.L (GHC.EpAnn anc an csd') a
css = cs <> GHC.EpaComments move
+ moveComments _ dd cs = (dd,cs)
(ds',an') = rebalance (GHC.hsmodDecls p, GHC.hsmodAnn $ GHC.hsmodExt p)
p' = p { GHC.hsmodExt = (GHC.hsmodExt p){ GHC.hsmodAnn = an' },
GHC.hsmodDecls = ds'
}
+
rebalance :: ([GHC.LHsDecl GHC.GhcPs], GHC.EpAnn GHC.AnnsModule)
-> ([GHC.LHsDecl GHC.GhcPs], GHC.EpAnn GHC.AnnsModule)
rebalance (ds, GHC.EpAnn a an cs) = (ds1, GHC.EpAnn a an cs')
=====================================
utils/check-exact/Transform.hs
=====================================
@@ -255,6 +255,8 @@ setEntryDPDecl d dp = setEntryDP d dp
setEntryDP :: LocatedAn t a -> DeltaPos -> LocatedAn t a
setEntryDP (L (EpAnn (EpaSpan ss@(UnhelpfulSpan _)) an cs) a) dp
= L (EpAnn (EpaDelta ss dp []) an cs) a
+setEntryDP (L (EpAnn (EpaSpan ss@(GeneratedSrcSpan _)) an cs) a) dp
+ = L (EpAnn (EpaDelta ss dp []) an cs) a
setEntryDP (L (EpAnn (EpaSpan ss) an (EpaComments [])) a) dp
= L (EpAnn (EpaDelta ss dp []) an (EpaComments [])) a
setEntryDP (L (EpAnn (EpaDelta ss d csd) an cs) a) dp
@@ -320,14 +322,12 @@ getEntryDP _ = SameLine 1
addEpaLocationDelta :: LayoutStartCol -> RealSrcSpan -> EpaLocation -> EpaLocation
addEpaLocationDelta _off _anc (EpaDelta ss d cs) = EpaDelta ss d cs
-addEpaLocationDelta _off _anc (EpaSpan ss@(UnhelpfulSpan _)) = EpaDelta ss (SameLine 0) []
addEpaLocationDelta off anc (EpaSpan ss@(RealSrcSpan r _))
= EpaDelta ss (adjustDeltaForOffset off (ss2deltaEnd anc r)) []
+addEpaLocationDelta _off _anc (EpaSpan ss) = EpaDelta ss (SameLine 0) []
-- Set the entry DP for an element coming after an existing keyword annotation
setEntryDPFromAnchor :: LayoutStartCol -> EpaLocation -> LocatedA t -> LocatedA t
-setEntryDPFromAnchor _off (EpaDelta _ _ _) (L la a) = L la a
-setEntryDPFromAnchor _off (EpaSpan (UnhelpfulSpan _)) (L la a) = L la a
setEntryDPFromAnchor off (EpaSpan (RealSrcSpan anc _)) ll@(L la _) = setEntryDP ll dp'
where
dp' = case la of
@@ -335,6 +335,8 @@ setEntryDPFromAnchor off (EpaSpan (RealSrcSpan anc _)) ll@(L la _) = setEntryDP
(EpAnn (EpaSpan _) _ _) -> adjustDeltaForOffset off (SameLine 0)
(EpAnn (EpaDelta _ dp _) _ _) -> adjustDeltaForOffset off dp
+setEntryDPFromAnchor _off _ ll = ll
+
-- ---------------------------------------------------------------------
-- |Take the annEntryDelta associated with the first item and
@@ -902,7 +904,7 @@ instance HasDecls (LocatedA (HsExpr GhcPs)) where
let
off = case l of
(EpaSpan (RealSrcSpan r _)) -> LayoutStartCol $ snd $ ss2pos r
- (EpaSpan (UnhelpfulSpan _)) -> LayoutStartCol 0
+ (EpaSpan _) -> LayoutStartCol 0
(EpaDelta _ (SameLine _) _) -> LayoutStartCol 0
(EpaDelta _ (DifferentLine _ c) _) -> LayoutStartCol c
ex'' = setEntryDPFromAnchor off i ex
=====================================
utils/check-exact/Utils.hs
=====================================
@@ -530,9 +530,10 @@ sortEpaComments cs = sortBy cmp cs
-- | Makes a comment which originates from a specific keyword.
mkKWComment :: String -> NoCommentsLocation -> Comment
-mkKWComment kw (EpaSpan (RealSrcSpan ss mb)) = Comment kw (EpaSpan (RealSrcSpan ss mb)) ss (Just kw)
-mkKWComment kw (EpaSpan (UnhelpfulSpan _)) = Comment kw (EpaDelta noSrcSpan (SameLine 0) NoComments) placeholderRealSpan (Just kw)
mkKWComment kw (EpaDelta ss dp cs) = Comment kw (EpaDelta ss dp cs) placeholderRealSpan (Just kw)
+mkKWComment kw (EpaSpan (RealSrcSpan ss mb)) = Comment kw (EpaSpan (RealSrcSpan ss mb)) ss (Just kw)
+mkKWComment kw (EpaSpan _) = Comment kw (EpaDelta noSrcSpan (SameLine 0) NoComments) placeholderRealSpan (Just kw)
+
sortAnchorLocated :: [GenLocated EpaLocation a] -> [GenLocated EpaLocation a]
sortAnchorLocated = sortBy (compare `on` (epaLocationRealSrcSpan . getLoc))
=====================================
utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
=====================================
@@ -105,10 +105,13 @@ parse parserOpts sDocContext fpath bs = case unP (go False []) initState of
parsePlainTok inPrag = do
(bInit, lInit) <- lift getInput
L sp tok <- tryP (Lexer.lexer False return)
- (bEnd, _) <- lift getInput
case sp of
- UnhelpfulSpan _ -> pure ([], False) -- pretend the token never existed
- RealSrcSpan rsp _ -> do
+ RealSrcSpan rsp _ -> tryParse inPrag rsp bInit lInit sp tok
+ GeneratedSrcSpan (OrigSpan rsp) -> tryParse inPrag rsp bInit lInit sp tok
+ _ -> pure ([], False) -- pretend the token never existed
+
+ tryParse inPrag rsp bInit lInit sp tok = do
+ (bEnd, _) <- lift getInput
let typ = if inPrag then TkPragma else classify tok
RealSrcLoc lStart _ = srcSpanStart sp -- safe since @sp@ is real
(spaceBStr, bStart) = spanPosition lInit lStart bInit
=====================================
utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs
=====================================
@@ -53,7 +53,7 @@ module Haddock.Backends.Xhtml.Utils
, collapseControl
) where
-import GHC (Name, SrcSpan (..), srcSpanStartLine)
+import GHC (Name, SrcSpan (..), GeneratedSrcSpanDetails (..), srcSpanStartLine)
import GHC.Types.Name (getOccString, isValOcc, nameOccName)
import GHC.Unit.Module (Module, ModuleName, moduleName, moduleNameString)
import Text.XHtml hiding (name, p, quote, title)
@@ -103,6 +103,10 @@ spliceURL' maybe_mod maybe_name maybe_loc = run
case span_ of
RealSrcSpan span__ _ ->
show $ srcSpanStartLine span__
+ GeneratedSrcSpan sp ->
+ case sp of
+ OrigSpan span__ -> show $ srcSpanStartLine span__
+ _ -> ""
UnhelpfulSpan _ -> ""
run "" = ""
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/97246591adca6ce6fe1c3383e452339…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/97246591adca6ce6fe1c3383e452339…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/andreask/linker_fix] Remove now redundant thin archive special case.
by Andreas Klebinger (@AndreasK) 20 Jan '26
by Andreas Klebinger (@AndreasK) 20 Jan '26
20 Jan '26
Andreas Klebinger pushed to branch wip/andreask/linker_fix at Glasgow Haskell Compiler / GHC
Commits:
bcf76dcc by Andreas Klebinger at 2026-01-20T15:18:16+01:00
Remove now redundant thin archive special case.
- - - - -
1 changed file:
- rts/linker/LoadArchive.c
Changes:
=====================================
rts/linker/LoadArchive.c
=====================================
@@ -552,9 +552,6 @@ HsInt loadArchive_ (pathchar *path)
if (!readThinArchiveMember(n, memberSize, path, fileName, image)) {
goto fail;
}
- // Unlike for regular archives for thin archives we can only identify the object format
- // after having read the file pointed to.
- object_fmt = identifyObjectFile_(image, memberSize);
}
else
{
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bcf76dcc3577280023a7d57b80b8cc1…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bcf76dcc3577280023a7d57b80b8cc1…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
20 Jan '26
Hannes Siebenhandl pushed new branch wip/fendor/freeze-throw at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/fendor/freeze-throw
You're receiving this email because of your account on gitlab.haskell.org.
1
0