summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-08-31 13:11:41 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-09-01 12:01:56 -0400
commit7f527f01c8b4b61047fa87905750ee962f527e36 (patch)
tree0b9962e4ebf5a8f9c6ebe61c9af04841bf58a11e
parent31a8989a1d4aa5fe1e3ed0b2e789145bb64a8ba8 (diff)
downloadhaskell-7f527f01c8b4b61047fa87905750ee962f527e36.tar.gz
Fix bootstrap with ghc-9.0
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.