summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/Utils/Monad.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-02-11 09:41:44 +0100
committerBen Gamari <ben@smart-cactus.org>2020-06-17 16:22:03 -0400
commit96aa57878fd6e6a7b92e841a0df8b5255a559c97 (patch)
treeda1dabadf29c6b681682a4577b4ca08e29bc44a5 /compiler/GHC/Tc/Utils/Monad.hs
parent9f96bc127d6231b5e76bbab442244eb303b08867 (diff)
downloadhaskell-96aa57878fd6e6a7b92e841a0df8b5255a559c97.tar.gz
Update compiler
Thanks to ghc-bignum, the compiler can be simplified: * Types and constructors of Integer and Natural can be wired-in. It means that we don't have to query them from interfaces. It also means that numeric literals don't have to carry their type with them. * The same code is used whatever ghc-bignum backend is enabled. In particular, conversion of bignum literals into final Core expressions is now much more straightforward. Bignum closure inspection too. * GHC itself doesn't depend on any integer-* package anymore * The `integerLibrary` setting is gone.
Diffstat (limited to 'compiler/GHC/Tc/Utils/Monad.hs')
-rw-r--r--compiler/GHC/Tc/Utils/Monad.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/GHC/Tc/Utils/Monad.hs b/compiler/GHC/Tc/Utils/Monad.hs
index e485b667af..f1d82c1228 100644
--- a/compiler/GHC/Tc/Utils/Monad.hs
+++ b/compiler/GHC/Tc/Utils/Monad.hs
@@ -271,6 +271,7 @@ initTc hsc_env hsc_src keep_rn_syntax mod loc do_this
tcg_fix_env = emptyNameEnv,
tcg_field_env = emptyNameEnv,
tcg_default = if moduleUnit mod == primUnit
+ || moduleUnit mod == bignumUnit
then Just [] -- See Note [Default types]
else Nothing,
tcg_type_env = emptyNameEnv,
@@ -390,10 +391,10 @@ initTcInteractive hsc_env thing_inside
{- Note [Default types]
~~~~~~~~~~~~~~~~~~~~~~~
-The Integer type is simply not available in package ghc-prim (it is
-declared in integer-gmp). So we set the defaulting types to (Just
-[]), meaning there are no default types, rather then Nothing, which
-means "use the default default types of Integer, Double".
+The Integer type is simply not available in ghc-prim and ghc-bignum packages (it
+is declared in ghc-bignum). So we set the defaulting types to (Just []), meaning
+there are no default types, rather than Nothing, which means "use the default
+default types of Integer, Double".
If you don't do this, attempted defaulting in package ghc-prim causes
an actual crash (attempting to look up the Integer type).