summaryrefslogtreecommitdiff
path: root/libraries/ghc-bignum/src/GHC/Num
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2020-07-11 10:04:57 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-07-14 21:33:19 -0400
commite0db878a789e58c2a1aba2e73d42857008174124 (patch)
treec66f377a195775cfeded764c14db7a332b728480 /libraries/ghc-bignum/src/GHC/Num
parent2379722438cb551210c4899119ade05989c17166 (diff)
downloadhaskell-e0db878a789e58c2a1aba2e73d42857008174124.tar.gz
ghc-bignum: bring in sync .hs-boot files with module declarations
Before this change `BIGNUM_BACKEND=native` build was failing as: ``` libraries/ghc-bignum/src/GHC/Num/BigNat/Native.hs:708:16: error: * Variable not in scope: naturalFromBigNat# :: WordArray# -> t * Perhaps you meant one of these: `naturalFromBigNat' (imported from GHC.Num.Natural), `naturalToBigNat' (imported from GHC.Num.Natural) | 708 | m' = naturalFromBigNat# m | ``` This happens because `.hs-boot` files are slightly out of date. This change brings in data and function types in sync. Bug: https://gitlab.haskell.org/ghc/ghc/-/issues/18437 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'libraries/ghc-bignum/src/GHC/Num')
-rw-r--r--libraries/ghc-bignum/src/GHC/Num/BigNat.hs-boot19
-rw-r--r--libraries/ghc-bignum/src/GHC/Num/Natural.hs-boot4
2 files changed, 12 insertions, 11 deletions
diff --git a/libraries/ghc-bignum/src/GHC/Num/BigNat.hs-boot b/libraries/ghc-bignum/src/GHC/Num/BigNat.hs-boot
index 5c325d074f..90a3f11ea1 100644
--- a/libraries/ghc-bignum/src/GHC/Num/BigNat.hs-boot
+++ b/libraries/ghc-bignum/src/GHC/Num/BigNat.hs-boot
@@ -7,13 +7,14 @@ module GHC.Num.BigNat where
import GHC.Num.WordArray
import GHC.Prim
-type BigNat = WordArray#
+type BigNat# = WordArray#
+data BigNat = BN# { unBigNat :: BigNat# }
-bigNatSubUnsafe :: BigNat -> BigNat -> BigNat
-bigNatMulWord# :: BigNat -> Word# -> BigNat
-bigNatRem :: BigNat -> BigNat -> BigNat
-bigNatRemWord# :: BigNat -> Word# -> Word#
-bigNatShiftR# :: BigNat -> Word# -> BigNat
-bigNatShiftL# :: BigNat -> Word# -> BigNat
-bigNatCtz# :: BigNat -> Word#
-bigNatCtzWord# :: BigNat -> Word#
+bigNatSubUnsafe :: BigNat# -> BigNat# -> BigNat#
+bigNatMulWord# :: BigNat# -> Word# -> BigNat#
+bigNatRem :: BigNat# -> BigNat# -> BigNat#
+bigNatRemWord# :: BigNat# -> Word# -> Word#
+bigNatShiftR# :: BigNat# -> Word# -> BigNat#
+bigNatShiftL# :: BigNat# -> Word# -> BigNat#
+bigNatCtz# :: BigNat# -> Word#
+bigNatCtzWord# :: BigNat# -> Word#
diff --git a/libraries/ghc-bignum/src/GHC/Num/Natural.hs-boot b/libraries/ghc-bignum/src/GHC/Num/Natural.hs-boot
index 28cf5d1771..964292fa59 100644
--- a/libraries/ghc-bignum/src/GHC/Num/Natural.hs-boot
+++ b/libraries/ghc-bignum/src/GHC/Num/Natural.hs-boot
@@ -14,8 +14,8 @@ data Natural
naturalToWord# :: Natural -> Word#
naturalFromWord# :: Word# -> Natural
-naturalToBigNat :: Natural -> BigNat
-naturalFromBigNat :: BigNat -> Natural
+naturalFromBigNat# :: BigNat# -> Natural
+naturalToBigNat# :: Natural -> BigNat#
naturalMul :: Natural -> Natural -> Natural
naturalRem :: Natural -> Natural -> Natural
naturalIsZero :: Natural -> Bool