summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-08-31 13:11:41 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2022-08-31 13:13:34 +0100
commit0f81a5ddd49ce0024305bdcd004ea6bd71ef5832 (patch)
treeea6e698c958b310089e282b80c73a8737c4a0c40
parentcbe51ac5e0bbe2667b6c7204ae62a534a9bc7c95 (diff)
downloadhaskell-wip/fix-9.0-boostrap.tar.gz
Fix bootstrap with ghc-9.0wip/fix-9.0-boostrap
It turns out Solo is a very recent addition to base, so for older GHC versions we just defined it inline here the one place we use it in the compiler.
-rw-r--r--compiler/GHC/Core/Opt/SpecConstr.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/GHC/Core/Opt/SpecConstr.hs b/compiler/GHC/Core/Opt/SpecConstr.hs
index 6cba93023b..2eb5862039 100644
--- a/compiler/GHC/Core/Opt/SpecConstr.hs
+++ b/compiler/GHC/Core/Opt/SpecConstr.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-
ToDo [Oct 2013]
~~~~~~~~~~~~~~~
@@ -974,6 +975,14 @@ lookupHowBound env id = lookupVarEnv (sc_how_bound env) id
scSubstId :: ScEnv -> InId -> OutExpr
scSubstId env v = lookupIdSubst (sc_subst env) v
+
+-- Solo is only defined in base starting from ghc-9.2
+#if !(MIN_VERSION_base(4, 16, 0))
+
+data Solo a = Solo a
+
+#endif
+
-- The !subst ensures that we force the selection `(sc_subst env)`, which avoids
-- retaining all of `env` when we only need `subst`. The `Solo` means that the
-- substitution itself is lazy, because that type is often discarded.