[Git][ghc/ghc][wip/T26343] base: don't expose GHC.Num.{BigNat, Integer, Natural}
Teo Camarasu pushed to branch wip/T26343 at Glasgow Haskell Compiler / GHC Commits: ad48bb4b by Teo Camarasu at 2025-08-24T13:11:48+01:00 base: don't expose GHC.Num.{BigNat, Integer, Natural} WIP - - - - - 9 changed files: - libraries/base/base.cabal.in - libraries/base/src/Data/Array/Byte.hs - libraries/base/src/GHC/Num.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 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/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.hs ===================================== @@ -16,11 +16,11 @@ module GHC.Num ( Num(..) , subtract , quotRemInteger - , module GHC.Num.Integer - , module GHC.Num.Natural + , module GHC.Internal.Bignum.Integer + , module GHC.Internal.Bignum.Natural ) where import GHC.Internal.Num -import GHC.Num.Integer -import GHC.Num.Natural +import GHC.Internal.Bignum.Integer +import GHC.Internal.Bignum.Natural ===================================== 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) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ad48bb4b6f76923073391d8e9f56203e... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ad48bb4b6f76923073391d8e9f56203e... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Teo Camarasu (@teo)