[Git][ghc/ghc][master] configure: remove unused win32-tarballs.md5sum
by Marge Bot (@marge-bot) 23 Dec '25
by Marge Bot (@marge-bot) 23 Dec '25
23 Dec '25
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
30e513ba by Cheng Shao at 2025-12-22T17:12:00-05:00
configure: remove unused win32-tarballs.md5sum
This patch removes the unused `win32-tarballs.md5sum` file from the
tree. The current mingw tarball download logic in
`mk/get-win32-tarballs.py` fetches and checks against `SHA256SUM` from
the same location where the tarballs are fetched, and this file has
been unused for a few years.
- - - - -
2 changed files:
- .gitattributes
- − mk/win32-tarballs.md5sum
Changes:
=====================================
.gitattributes
=====================================
@@ -1,5 +1,4 @@
# convert CRLF into LF on checkin
# don't convert anything on checkout
* text=auto eol=lf
-mk/win32-tarballs.md5sum text=auto eol=LF
testsuite/tests/parser/should_run/T25375.hs text=auto eol=crlf
=====================================
mk/win32-tarballs.md5sum deleted
=====================================
@@ -1,28 +0,0 @@
-8af4600c30671775a1dde3b60fe75854 ghc-tarballs/mingw-w64/i686/mingw-w64-i686-binutils-2.32-3-phyx.pkg.tar.xz
-c442f8999c10a24059a79a0a8974bc46 ghc-tarballs/mingw-w64/i686/mingw-w64-i686-crt-git-7.0.0.5491.fe45801e-1-any.pkg.tar.xz
-dddc20e7431ab369f6e2726feb4f65d1 ghc-tarballs/mingw-w64/i686/mingw-w64-i686-gcc-9.2.0-1-phyx.pkg.tar.xz
-64130e9d870de2292d4627a67fabee51 ghc-tarballs/mingw-w64/i686/mingw-w64-i686-gcc-libs-9.2.0-1-phyx.pkg.tar.xz
-2f97e71e4ec122151c20350433268d8b ghc-tarballs/mingw-w64/i686/mingw-w64-i686-gmp-6.1.2-1-any.pkg.tar.xz
-192a25fe284cf8a78851a673d6ef672a ghc-tarballs/mingw-w64/i686/mingw-w64-i686-headers-git-7.0.0.5490.9ec54ed1-1-any.pkg.tar.xz
-a18983513ec46ff0716dc5742604a78b ghc-tarballs/mingw-w64/i686/mingw-w64-i686-isl-0.21-1-any.pkg.tar.xz
-c8dabb32fabe2492878e070ffad473f0 ghc-tarballs/mingw-w64/i686/mingw-w64-i686-libidn2-2.2.0-1-any.pkg.tar.xz
-d05ca6e90126c17db19a8cd32e7347e8 ghc-tarballs/mingw-w64/i686/mingw-w64-i686-libwinpthread-git-7.0.0.5480.e14d23be-1-any.pkg.tar.xz
-cae596bd144ad70875ef8f21e5bdb77d ghc-tarballs/mingw-w64/i686/mingw-w64-i686-mpc-1.1.0-1-any.pkg.tar.xz
-317a7a490da5c88f63638fbc5461b51e ghc-tarballs/mingw-w64/i686/mingw-w64-i686-mpfr-4.0.2-2-any.pkg.tar.xz
-15a5557d7b321bb26436dcf7adced5b7 ghc-tarballs/mingw-w64/i686/mingw-w64-i686-windows-default-manifest-6.4-3-any.pkg.tar.xz
-beb76cd6141d11c000a1f5ff2ad34971 ghc-tarballs/mingw-w64/i686/mingw-w64-i686-winpthreads-git-7.0.0.5480.e14d23be-1-any.pkg.tar.xz
-87c65e9b2930436a75dfd7d459ae98cb ghc-tarballs/mingw-w64/i686/mingw-w64-i686-zlib-1.2.8-9-any.pkg.tar.xz
-4dca7def5591b8f999e5fa20084cc7a9 ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-binutils-2.32-3-phyx.pkg.tar.xz
-d4336ca77b5edf3126a6c1358952567a ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-crt-git-7.0.0.5491.fe45801e-1-any.pkg.tar.xz
-e84e0426204b73af13752b65a035dfc2 ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-gcc-9.2.0-1-phyx.pkg.tar.xz
-b6200865004cb558c8f5cd7526975602 ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-gcc-libs-9.2.0-1-phyx.pkg.tar.xz
-1e1f79abc9fc0534d360c2889b10a9f5 ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-gmp-6.1.2-1-any.pkg.tar.xz
-ef6ad2b29b92264c78d7ba6f0a875838 ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-headers-git-7.0.0.5490.9ec54ed1-1-any.pkg.tar.xz
-623c059a9691ee7fc74b9e3f89b35782 ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-isl-0.21-1-any.pkg.tar.xz
-29a39230c6208366b9d046fbe5bdde6f ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-libidn2-2.2.0-1-any.pkg.tar.xz
-9953a82fd713f0c7ece69d9228238f4d ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-libwinpthread-git-7.0.0.5480.e14d23be-1-any.pkg.tar.xz
-c3aa7f45926edaaafe3bba988e327271 ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-mpc-1.1.0-1-any.pkg.tar.xz
-951d8046e65768e00b6dfe1bb6e23016 ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-mpfr-4.0.2-2-any.pkg.tar.xz
-8360a1dd2f6f4fd518907530f0839a48 ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-windows-default-manifest-6.4-3-any.pkg.tar.xz
-e7cf8d4ac9e9b3f79c16a09413dd1322 ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-winpthreads-git-7.0.0.5480.e14d23be-1-any.pkg.tar.xz
-60c3a388478f411b7a0908441ebeb537 ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-zlib-1.2.8-9-any.pkg.tar.xz
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/30e513bab08193f80077d511f39594d…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/30e513bab08193f80077d511f39594d…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][master] 2 commits: Do deep subsumption when computing valid hole fits
by Marge Bot (@marge-bot) 23 Dec '25
by Marge Bot (@marge-bot) 23 Dec '25
23 Dec '25
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
db1ce858 by sheaf at 2025-12-22T17:11:17-05:00
Do deep subsumption when computing valid hole fits
This commit makes a couple of improvements to the code that
computes "valid hole fits":
1. It uses deep subsumption for data constructors.
This matches up the multiplicities, as per
Note [Typechecking data constructors].
This fixes #26338 (test: LinearHoleFits).
2. It now suggests (non-unidirectional) pattern synonyms as valid
hole fits. This fixes #26339 (test: PatSynHoleFit).
3. It uses 'stableNameCmp', to make the hole fit output deterministic.
-------------------------
Metric Increase:
hard_hole_fits
-------------------------
- - - - -
72ee9100 by sheaf at 2025-12-22T17:11:17-05:00
Speed up hole fits with a quick pre-test
This speeds up the machinery for valid hole fits by doing a small
check to rule out obviously wrong hole fits, such as:
1. A hole fit identifier whose type has a different TyCon at the head,
after looking through foralls and (=>) arrows, e.g.:
hole_ty = Int
cand_ty = Maybe a
or
hole_ty = forall a b. a -> b
cand_ty = forall x y. Either x y
2. A hole fit identifier that is not polymorphic when the hole type
is polymorphic, e.g.
hole_ty = forall a. a -> a
cand_ty = Int -> Int
-------------------------
Metric Decrease:
hard_hole_fits
-------------------------
- - - - -
29 changed files:
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Tc/Errors/Hole.hs
- compiler/GHC/Tc/Errors/Hole/FitTypes.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Utils/Unify.hs
- docs/users_guide/9.16.1-notes.rst
- testsuite/tests/ghci/scripts/T8353.stderr
- testsuite/tests/overloadedrecflds/should_fail/DRFHoleFits.stderr
- testsuite/tests/perf/compiler/hard_hole_fits.stderr
- testsuite/tests/plugins/test-hole-plugin.stderr
- testsuite/tests/th/T15321.stderr
- testsuite/tests/typecheck/should_compile/T13050.stderr
- testsuite/tests/typecheck/should_compile/T14273.stderr
- testsuite/tests/typecheck/should_compile/T14590.stderr
- testsuite/tests/typecheck/should_compile/T25180.stderr
- testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr
- testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr
- testsuite/tests/typecheck/should_compile/free_monad_hole_fits.stderr
- testsuite/tests/typecheck/should_compile/hole_constraints.stderr
- testsuite/tests/typecheck/should_compile/holes.stderr
- testsuite/tests/typecheck/should_compile/holes2.stderr
- testsuite/tests/typecheck/should_compile/holes3.stderr
- testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr
- testsuite/tests/typecheck/should_compile/subsumption_sort_hole_fits.stderr
- testsuite/tests/typecheck/should_compile/type_in_type_hole_fits.stderr
- testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr
- testsuite/tests/typecheck/should_compile/valid_hole_fits_interactions.stderr
- testsuite/tests/typecheck/should_fail/T14884.stderr
Changes:
=====================================
compiler/GHC/Core/DataCon.hs
=====================================
@@ -30,7 +30,7 @@ module GHC.Core.DataCon (
dataConRepType, dataConInstSig, dataConFullSig,
dataConName, dataConIdentity, dataConTag, dataConTagZ,
dataConTyCon, dataConOrigTyCon,
- dataConWrapperType, dataConNonlinearType,
+ dataConWrapperType,
dataConUnivTyVars, dataConExTyCoVars, dataConUnivAndExTyCoVars,
dataConConcreteTyVars,
dataConUserTyVars, dataConUserTyVarBinders,
@@ -1568,23 +1568,6 @@ dataConWrapperType (MkData { dcUserTyVarBinders = user_tvbs,
mkScaledFunTys arg_tys $
res_ty
-dataConNonlinearType :: DataCon -> Type
--- ^ Just like 'dataConWrapperType', but with the
--- linearity on the arguments all zapped to Many.
---
--- Only used temporarily as a stop-gap for hole fit suggestions
--- until #26338 is fixed.
-dataConNonlinearType (MkData { dcUserTyVarBinders = user_tvbs,
- dcOtherTheta = theta, dcOrigArgTys = arg_tys,
- dcOrigResTy = res_ty,
- dcStupidTheta = stupid_theta })
- = mkForAllTys user_tvbs $
- mkInvisFunTys (stupid_theta ++ theta) $
- mkScaledFunTys arg_tys' $
- res_ty
- where
- arg_tys' = map (\(Scaled w t) -> Scaled (case w of OneTy -> ManyTy; _ -> w) t) arg_tys
-
-- | Finds the instantiated types of the arguments required to construct a
-- 'DataCon' representation
-- NB: these INCLUDE any dictionary args
=====================================
compiler/GHC/Tc/Errors/Hole.hs
=====================================
@@ -36,13 +36,16 @@ import GHC.Tc.Utils.Monad
import GHC.Tc.Types.Constraint
import GHC.Tc.Types.Origin
import GHC.Tc.Utils.TcMType
+import GHC.Tc.TyCl.PatSyn (patSynBuilderOcc)
import GHC.Tc.Types.Evidence
import GHC.Tc.Types.CtLoc
import GHC.Tc.Utils.TcType
import GHC.Tc.Zonk.TcType
import GHC.Core.TyCon( TyCon, isGenerativeTyCon )
import GHC.Core.TyCo.Rep( Type(..) )
+import GHC.Core.Type (funTyFlagTyCon)
import GHC.Core.DataCon
+import GHC.Core.PatSyn (patSynName)
import GHC.Core.Predicate( Pred(..), classifyPredType, eqRelRole )
import GHC.Types.Basic
import GHC.Types.Name
@@ -50,6 +53,8 @@ import GHC.Types.Name.Reader
import GHC.Builtin.Names ( gHC_INTERNAL_ERR, gHC_INTERNAL_UNSAFE_COERCE )
import GHC.Builtin.Types ( tupleDataConName, unboxedSumDataConName )
import GHC.Types.Id
+import GHC.Types.Name.Set (extendNameSet, NameSet, emptyNameSet)
+import GHC.Types.Var (isVisibleFunArg)
import GHC.Types.Var.Set
import GHC.Types.Var.Env
import GHC.Types.TyThing
@@ -71,7 +76,10 @@ import Data.Graph ( graphFromEdges, topSort )
import GHC.Tc.Solver ( simplifyTopWanteds )
import GHC.Tc.Solver.Monad ( runTcSEarlyAbort )
-import GHC.Tc.Utils.Unify ( tcSubTypeSigma )
+import GHC.Tc.Utils.Unify
+ ( DeepSubsumptionFlag(..), DeepSubsumptionDepth(..)
+ , tcSubTypeHoleFit
+ )
import GHC.HsToCore.Docs ( extractDocs )
import GHC.Hs.Doc
@@ -91,7 +99,6 @@ import GHC.Data.EnumSet (EnumSet)
import qualified GHC.Data.EnumSet as EnumSet
import qualified GHC.LanguageExtensions as LangExt
-
{-
Note [Valid hole fits include ...]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -245,6 +252,23 @@ In addition, we call withoutUnification to reset any unified metavariables; this
call is actually done outside tcCheckHoleFit so that the results can be formatted
for the user before resetting variables.
+Note [Deep subsumption in tcCheckHoleFit]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+To check that a candidate fits in a hole, we perform a subsumption check, as
+detailed in Note [Checking hole fits]. However, should we also perform deep
+subsumption? Well, certainly if the user has enabled deep subsumption, and also
+in cases where deep subsumption is required such as to perform eta-expansion
+of data constructors, e.g.
+
+ data T = MkT Int Bool -- so that MkT :: Int %1 -> Bool %1 -> T
+
+ foo :: Int %1 -> Bool -> T
+ foo = _
+
+We should suggest MkT as a valid hole fit, because deep subsumption will
+eta expand to make the multiplicities line up, as per
+Note [Typechecking data constructors] in GHC.Tc.Gen.Head.
+
Note [Valid refinement hole fits include ...]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When the `-frefinement-level-hole-fits=N` flag is given, we additionally look
@@ -405,24 +429,61 @@ is discarded.
Note [Speeding up valid hole-fits]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-To fix #16875 we noted that a lot of time was being spent on unnecessary work.
-
-When we'd call `tcCheckHoleFit hole hole_ty ty`, we would end up by generating
-a constraint to show that `hole_ty ~ ty`, including any constraints in `ty`. For
-example, if `hole_ty = Int` and `ty = Foldable t => (a -> Bool) -> t a -> Bool`,
-we'd have `(a_a1pa[sk:1] -> Bool) -> t_t2jk[sk:1] a_a1pa[sk:1] -> Bool ~# Int`
-from the coercion, as well as `Foldable t_t2jk[sk:1]`. By adding a flag to
-`TcSEnv` and adding a `runTcSEarlyAbort`, we can fail as soon as we hit
-an insoluble constraint. Since we don't need the result in the case that it
-fails, a boolean `False` (i.e. "it didn't work" from `runTcSEarlyAbort`)
-is sufficient.
-
-We also check whether the type of the hole is an immutable type variable (i.e.
-a skolem). In that case, the only possible fits are fits of exactly that type,
-which can only come from the locals. This speeds things up quite a bit when we
-don't know anything about the type of the hole. This also helps with degenerate
-fits like (`id (_ :: a)` and `head (_ :: [a])`) when looking for fits of type
-`a`, where `a` is a skolem.
+When computing valid hole fits, we want to quickly rule out identifiers that
+clearly don't fit the type of the hole, without doing too much work.
+This is important for the performance of the "valid hole fits" feature,
+which is known to be slow in some cases (#16875).
+
+The valid hole fits machinery is given the type of the hole and a possible
+candidate identifier, and it computes whether the identifier can be used by
+performing a subtype check
+
+ tcSubTypeHoleFit .. cand_ty hole_ty
+
+which checks that the type of the candidate identifier is more general than
+the type of the hole.
+
+We currently use the following shortcuts.
+
+ 1. When computing a set of candidate identifiers for a hole:
+
+ (FastHoles1)
+ If 'hole_ty' is an immutable type variable (i.e. a skolem type variable),
+ then the only possible (useful) fits are fits of exactly that type, which
+ can only come from locally bound variables for which that skolem is in scope.
+ In that case, only include local identifiers in the list of candidate Ids.
+
+ This speeds things up quite a bit when we don't know anything about the type
+ of the hole, and helps with degenerate fits like (`id (_ :: a)` and `head (_ :: [a])`)
+ when looking for fits of type `a`, where `a` is a skolem.
+
+ 2. When checking whether a particular candidate 'cand_ty :: cand_ty' fits 'hole_ty':
+
+ (FastHoles2)
+ Abort early if 'cand_ty' is obviously not a subtype of 'hole_ty',
+ according to a cheap test. The current cheap test is in 'definitelyNotSubType',
+ which detects the following cases:
+
+ 1. 'cand_ty' and 'hole_ty' have a different TyCon at the head, after
+ looking through foralls and (=>) arrows, e.g.:
+ hole_ty = Int -- headed by Int
+ cand_ty = Maybe a -- headed by Maybe
+ or
+ hole_ty = forall a b. a -> b -- headed by (->)
+ cand_ty = forall x y. Num x => Either x y -- headed by Either
+ 2. 'hole_ty' is polymorphic but 'cand_ty' has no polymorphism, e.g.
+ hole_ty = forall a. a -> a
+ cand_ty = Int -> Int
+
+ (FastHoles3)
+ After calling 'tcSubTypeHoleFit' but before running the solver on the
+ constraints that it generated, do a quick check to see if any constraint
+ is obviously insoluble. See Note [tcCheckHoleFit: fast insolubility check].
+
+ (FastHoles4)
+ When running the solver on the constraints generated by 'tcSubTypeHoleFit',
+ do it in a special mode that stops immediately as soon as it spots an
+ insoluble constraint, using 'runTcSEarlyAbort'.
-}
-- We read the various -no-show-*-of-hole-fits flags
@@ -517,8 +578,6 @@ getLocalBindings tidy_orig ct_loc
discard_it = go env sofar tc_bndrs
keep_it id = go env (id:sofar) tc_bndrs
-
-
-- See Note [Valid hole fits include ...]
findValidHoleFits :: TidyEnv -- ^ The tidy_env for zonking
-> [Implication] -- ^ Enclosing implications for givens
@@ -558,8 +617,10 @@ findValidHoleFits tidy_env implics simples h@(Hole { hole_sort = ExprHole _
map IdHFCand lclBinds ++ map GreHFCand lcl
globals = map GreHFCand gbl
syntax = map NameHFCand (builtIns exts)
- -- If the hole is a rigid type-variable, then we only check the
+
+ -- If the hole is a rigid type variable, then we only check the
-- locals, since only they can match the type (in a meaningful way).
+ -- See (FastHoles1) in Note [Speeding up valid hole-fits].
only_locals = any isImmutableTyVar $ getTyVar_maybe hole_ty
to_check = if only_locals then locals
else locals ++ syntax ++ globals
@@ -679,7 +740,6 @@ findValidHoleFits tidy_env implics simples h@(Hole { hole_sort = ExprHole _
possiblyDiscard (Just max) fits = (fits `lengthExceeds` max, take max fits)
possiblyDiscard Nothing fits = (False, fits)
-
-- We don't (as of yet) handle holes in types, only in expressions.
findValidHoleFits env _ _ _ = return (env, noValidHoleFits)
@@ -732,13 +792,14 @@ sortHoleFitsBySize = return . sortOn sizeOfFit
-- '-fno-sort-valid-hole-fits'.
sortHoleFitsByGraph :: [TcHoleFit] -> TcM [TcHoleFit]
sortHoleFitsByGraph fits = go [] fits
- where tcSubsumesWCloning :: TcType -> TcType -> TcM Bool
- tcSubsumesWCloning ht ty = withoutUnification fvs (tcSubsumes ht ty)
- where fvs = tyCoFVsOfTypes [ht,ty]
+ where tcSubsumesWCloning :: TcSigmaType -> TcSigmaType -> TcM Bool
+ tcSubsumesWCloning fit_ty cand_ty =
+ withoutUnification (tyCoFVsOfTypes [fit_ty, cand_ty]) $
+ tcSubsumes fit_ty cand_ty
go :: [(TcHoleFit, [TcHoleFit])] -> [TcHoleFit] -> TcM [TcHoleFit]
go sofar [] = do { traceTc "subsumptionGraph was" $ ppr sofar
; return $ uncurry (++) $ partition hfIsLcl topSorted }
- where toV (hf, adjs) = (hf, hfId hf, map hfId adjs)
+ where toV (hf, adjs) = (hf, hfName hf, map hfName adjs)
(graph, fromV, _) = graphFromEdges $ map toV sofar
topSorted = map ((\(h,_,_) -> h) . fromV) $ topSort graph
go sofar (hf:hfs) =
@@ -763,7 +824,7 @@ tcFilterHoleFits :: Maybe Int
tcFilterHoleFits (Just 0) _ _ _ = return (False, []) -- Stop right away on 0
tcFilterHoleFits limit typed_hole ht@(hole_ty, _) candidates =
do { traceTc "checkingFitsFor {" $ ppr hole_ty
- ; (discards, subs) <- go [] emptyVarSet limit ht candidates
+ ; (discards, subs) <- go [] emptyNameSet limit ht candidates
; traceTc "checkingFitsFor }" empty
; return (discards, subs) }
where
@@ -772,8 +833,8 @@ tcFilterHoleFits limit typed_hole ht@(hole_ty, _) candidates =
-- Kickoff the checking of the elements.
-- We iterate over the elements, checking each one in turn for whether
-- it fits, and adding it to the results if it does.
- go :: [TcHoleFit] -- What we've found so far.
- -> VarSet -- Ids we've already checked
+ go :: [TcHoleFit] -- What we've found so far.
+ -> NameSet -- Names of identifiers we have already checked
-> Maybe Int -- How many we're allowed to find, if limited
-> (TcType, [TcTyVar]) -- The type, and its refinement variables.
-> [HoleFitCandidate] -- The elements we've yet to check.
@@ -786,40 +847,59 @@ tcFilterHoleFits limit typed_hole ht@(hole_ty, _) candidates =
do { traceTc "lookingUp" $ ppr el
; maybeThing <- lookup el
; case maybeThing of
- Just (id, id_ty) | not_trivial id ->
- do { fits <- fitsHole ty id_ty
+ Just cand@(_, is_dc, cand_ty) ->
+ do { fits <- fitsHole ty cand_ty is_dc
; case fits of
- Just (wrp, matches) -> keep_it id id_ty wrp matches
+ Just (wrp, matches) -> keep_it cand wrp matches
_ -> discard_it }
_ -> discard_it }
where
- -- We want to filter out undefined and the likes from GHC.Err (#17940)
- not_trivial id = nameModule_maybe (idName id) `notElem` [Just gHC_INTERNAL_ERR, Just gHC_INTERNAL_UNSAFE_COERCE]
-
- lookup :: HoleFitCandidate -> TcM (Maybe (Id, Type))
- lookup (IdHFCand id) = return (Just (id, idType id))
- lookup hfc = do { thing <- tcLookup name
- ; return $ case thing of
- ATcId {tct_id = id} -> Just (id, idType id)
- AGlobal (AnId id) -> Just (id, idType id)
- AGlobal (AConLike (RealDataCon con)) ->
- Just (dataConWrapId con, dataConNonlinearType con)
- _ -> Nothing }
- where name = case hfc of
- GreHFCand gre -> greName gre
- NameHFCand name -> name
+ mk_id i
+ -- Filter out undefined and the likes from GHC.Err (#17940).
+ --
+ -- TODO: we might want to filter out more, e.g. if the user defines
+ --
+ -- todo :: forall a. a
+ -- todo = undefined
+ --
+ -- we probably don't want to suggest 'todo' as a hole fit either.
+ | let nm = idName i
+ , nameModule_maybe nm `notElem` [Just gHC_INTERNAL_ERR, Just gHC_INTERNAL_UNSAFE_COERCE]
+ = Just (nm, False, idType i)
+ | otherwise
+ = Nothing
+
+ lookup :: HoleFitCandidate -> TcM (Maybe (Name, Bool, Type))
+ lookup (IdHFCand id) = return $ mk_id id
+ lookup hfc =
+ do { thing <- tcLookup name
+ ; return $
+ case thing of
+ ATcId {tct_id = id} -> mk_id id
+ AGlobal (AnId id) -> mk_id id
+ AGlobal (AConLike (RealDataCon con)) ->
+ Just (dataConName con, True, dataConWrapperType con)
+ AGlobal (AConLike (PatSynCon ps))
+ | Just (_,t) <- patSynBuilderOcc ps
+ -> -- If we ever get a 'Todo' pattern synonym,
+ -- we should filter it out here.
+ Just (patSynName ps, False, t)
+ _ -> Nothing }
+
+ where
+ name = case hfc of
+ GreHFCand gre -> greName gre
+ NameHFCand name -> name
+
discard_it = go subs seen maxleft ty elts
- keep_it eid eid_ty wrp ms = go (fit:subs) (extendVarSet seen eid)
+ keep_it (enm, _, ety) wrp ms = go (fit:subs) (extendNameSet seen enm)
((\n -> n - 1) <$> maxleft) ty elts
where
- fit = HoleFit { hfId = eid, hfCand = el, hfType = eid_ty
+ fit = HoleFit { hfName = enm, hfCand = el, hfType = ety
, hfRefLvl = length (snd ty)
, hfWrap = wrp, hfMatches = ms
, hfDoc = Nothing }
-
-
-
unfoldWrapper :: HsWrapper -> [Type]
unfoldWrapper = reverse . unfWrp'
where
@@ -828,7 +908,6 @@ tcFilterHoleFits limit typed_hole ht@(hole_ty, _) candidates =
unfWrp' (WpCompose w1 w2) = unfWrp' w1 ++ unfWrp' w2
unfWrp' _ = []
-
-- The real work happens here, where we invoke the type checker using
-- tcCheckHoleFit to see whether the given type fits the hole.
fitsHole :: (TcType, [TcTyVar]) -- The type of the hole wrapped with the
@@ -845,27 +924,36 @@ tcFilterHoleFits limit typed_hole ht@(hole_ty, _) candidates =
-- In the base case with no additional
-- holes, h_ty will just be t and ref_vars
-- will be [].
- -> TcType -- The type we're checking to whether it can be
- -- instantiated to the type h_ty.
+ -> TcType -- The type of the hole fit candidate
+ -> Bool -- Is the hole fit candidate a data constructor?
-> TcM (Maybe ([TcType], [TcType])) -- If it is not a match, we
-- return Nothing. Otherwise,
-- we Just return the list of
-- types that quantified type
- -- variables in ty would take
+ -- variables in cand_ty would take
-- if used in place of h_ty,
-- and the list types of any
-- additional holes simulated
-- with the refinement
-- variables in ref_vars.
- fitsHole (h_ty, ref_vars) ty =
+ fitsHole (h_ty, ref_vars) cand_ty cand_is_datacon =
-- We wrap this with the withoutUnification to avoid having side-effects
-- beyond the check, but we rely on the side-effects when looking for
-- refinement hole fits, so we can't wrap the side-effects deeper than this.
withoutUnification fvs $
- do { traceTc "checkingFitOf {" $ ppr ty
- ; (fits, wrp) <- tcCheckHoleFit hole h_ty ty
- ; traceTc "Did it fit?" $ ppr fits
- ; traceTc "wrap is: " $ ppr wrp
+ do { traceTc "checkingFitOf {" $ ppr cand_ty
+
+ -- Compute 'ds_flag' with the same logic as 'getDeepSubsumptionFlag_DataConHead'.
+ ; user_ds <- xoptM LangExt.DeepSubsumption
+ ; let ds_flag
+ | user_ds
+ = Deep DeepSub
+ | cand_is_datacon
+ = Deep TopSub
+ | otherwise
+ = Shallow
+ ; mbWrap <- tcCheckHoleFit ds_flag hole h_ty cand_ty
+ ; traceTc "Did it fit?" $ ppr mbWrap
; traceTc "checkingFitOf }" empty
-- We'd like to avoid refinement suggestions like `id _ _` or
-- `head _ _`, and only suggest refinements where our all phantom
@@ -875,7 +963,8 @@ tcFilterHoleFits limit typed_hole ht@(hole_ty, _) candidates =
-- variables, i.e. zonk them to read their final value to check for
-- abstract refinements, and to report what the type of the simulated
-- holes must be for this to be a match.
- ; if fits then do {
+ ; case mbWrap of
+ { Just wrp -> do {
-- Zonking is expensive, so we only do it if required.
z_wrp_tys <- liftZonkM $ zonkTcTypes (unfoldWrapper wrp)
; if null ref_vars
@@ -895,12 +984,10 @@ tcFilterHoleFits limit typed_hole ht@(hole_ty, _) candidates =
; if allowAbstract || (allFilled && allConcrete )
then return $ Just (z_wrp_tys, z_vars)
else return Nothing }}
- else return Nothing }
- where fvs = mkFVs ref_vars `unionFV` hole_fvs `unionFV` tyCoFVsOfType ty
+ ; Nothing -> return Nothing } }
+ where fvs = mkFVs ref_vars `unionFV` hole_fvs `unionFV` tyCoFVsOfType cand_ty
hole = typed_hole { th_hole = Nothing }
-
-
-- | Checks whether a MetaTyVar is flexible or not.
isFlexiTyVar :: TcTyVar -> TcM Bool
isFlexiTyVar tv | isMetaTyVar tv = isFlexi <$> readMetaTyVar tv
@@ -923,7 +1010,7 @@ withoutUnification free_vars action =
-- discarding any errors. Subsumption here means that the ty_b can fit into the
-- ty_a, i.e. `tcSubsumes a b == True` if b is a subtype of a.
tcSubsumes :: TcSigmaType -> TcSigmaType -> TcM Bool
-tcSubsumes ty_a ty_b = fst <$> tcCheckHoleFit dummyHole ty_a ty_b
+tcSubsumes ty_a ty_b = isJust <$> tcCheckHoleFit Shallow dummyHole ty_a ty_b
where dummyHole = TypedHole { th_relevant_cts = emptyBag
, th_implics = []
, th_hole = Nothing }
@@ -932,16 +1019,22 @@ tcSubsumes ty_a ty_b = fst <$> tcCheckHoleFit dummyHole ty_a ty_b
-- #14273. This makes sure that when checking whether a type fits the hole,
-- the type has to be subsumed by type of the hole as well as fulfill all
-- constraints on the type of the hole.
-tcCheckHoleFit :: TypedHole -- ^ The hole to check against
+tcCheckHoleFit :: DeepSubsumptionFlag
+ -> TypedHole -- ^ The hole to check against
-> TcSigmaType
-- ^ The type of the hole to check against (possibly modified,
-- e.g. refined with additional holes for refinement hole-fits.)
- -> TcSigmaType -- ^ The type to check whether fits.
- -> TcM (Bool, HsWrapper)
- -- ^ Whether it was a match, and the wrapper from hole_ty to ty.
-tcCheckHoleFit _ hole_ty ty | hole_ty `eqType` ty
- = return (True, idHsWrapper)
-tcCheckHoleFit (TypedHole {..}) hole_ty ty = discardErrs $
+ -> TcSigmaType
+ -- ^ The candidate fit type
+ -> TcM (Maybe HsWrapper)
+ -- ^ Whether it was a match, and the wrapper from hole_ty to cand_ty
+tcCheckHoleFit _ _ hole_ty cand_ty
+ -- (FastHoles2) from Note [Speeding up valid hole-fits]
+ | definitelyNotSubType cand_ty hole_ty
+ = return Nothing
+ | hole_ty `eqType` cand_ty
+ = return $ Just idHsWrapper
+tcCheckHoleFit ds_flag (TypedHole {..}) hole_ty cand_ty = discardErrs $
do { -- We wrap the subtype constraint in the implications to pass along the
-- givens, and so we must ensure that any nested implications and skolems
-- end up with the correct level. The implications are ordered so that
@@ -952,16 +1045,21 @@ tcCheckHoleFit (TypedHole {..}) hole_ty ty = discardErrs $
[] -> getTcLevel
-- imp is the innermost implication
(imp:_) -> return (ic_tclvl imp)
- ; (wrap, wanted) <- setTcLevel innermost_lvl $ captureConstraints $
- tcSubTypeSigma orig (ExprSigCtxt NoRRC) ty hole_ty
+
+ ; (wrap, wanted) <-
+ setTcLevel innermost_lvl $ captureConstraints $
+ tcSubTypeHoleFit ds_flag orig cand_ty hole_ty
+ -- See Note [Deep subsumption in tcCheckHoleFit]
+
; traceTc "Checking hole fit {" empty
; traceTc "wanteds are: " $ ppr wanted
; if | isEmptyWC wanted, isEmptyBag th_relevant_cts
-> do { traceTc "}" empty
- ; return (True, wrap) }
+ ; return $ Just wrap }
- | checkInsoluble wanted -- See Note [Fast path for tcCheckHoleFit]
- -> return (False, wrap)
+ -- (FastHoles3) from Note [Speeding up valid hole-fits]
+ | checkInsoluble wanted
+ -> return Nothing
| otherwise
-> do { fresh_binds <- newTcEvBinds
@@ -979,10 +1077,16 @@ tcCheckHoleFit (TypedHole {..}) hole_ty ty = discardErrs $
-- the wanteds, because they are freshly generated by the
-- call to`tcSubtype_NC`.
; traceTc "final_wc is: " $ ppr final_wc
- -- See Note [Speeding up valid hole-fits]
- ; (rem, _) <- tryTc $ runTcSEarlyAbort $ simplifyTopWanteds final_wc
+
+ -- runTcSEarlyAbort: (FastHoles4) from Note [Speeding up valid hole-fits]
+ ; (rem, _) <- tryTc $ runTcSEarlyAbort
+ $ simplifyTopWanteds final_wc
; traceTc "}" empty
- ; return (any isSolvedWC rem, wrap) } }
+ ; return $
+ if any isSolvedWC rem
+ then Just wrap
+ else Nothing
+ } }
where
orig = ExprHoleOrigin (hole_occ <$> th_hole)
@@ -993,15 +1097,15 @@ tcCheckHoleFit (TypedHole {..}) hole_ty ty = discardErrs $
setWCAndBinds binds imp wc
= mkImplicWC $ unitBag $ imp { ic_wanted = wc , ic_binds = binds }
-{- Note [Fast path for tcCheckHoleFit]
+{- Note [tcCheckHoleFit: fast insolubility check]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-In `tcCheckHoleFit` we compare (with `tcSubTypeSigma`) the type of the hole
+In `tcCheckHoleFit` we compare (with `tcSubTypeHoleFit`) the type of the hole
with the type of zillions of in-scope functions, to see which would "fit".
Most of these checks fail! They generate obviously-insoluble constraints.
For these very-common cases we don't want to crank up the full constraint
solver. It's much more efficient to do a quick-and-dirty check for insolubility.
-Now, `tcSubTypeSigma` uses the on-the-fly unifier in GHC.Tc.Utils.Unify,
+Now, `tcSubTypeHoleFit` uses the on-the-fly unifier in GHC.Tc.Utils.Unify,
it has already done the dirt-simple unification. So our quick-and-dirty
check can simply look for constraints like (Int ~ Bool). We don't need
to worry about (Maybe Int ~ Maybe Bool).
@@ -1010,9 +1114,8 @@ The quick-and-dirty check is in `checkInsoluble`. It can make a big
difference: For test hard_hole_fits, compile-time allocation goes down by 37%!
-}
-
checkInsoluble :: WantedConstraints -> Bool
--- See Note [Fast path for tcCheckHoleFit]
+-- See Note [tcCheckHoleFit: fast insolubility check]
checkInsoluble (WC { wc_simple = simples })
= any is_insol simples
where
@@ -1021,7 +1124,7 @@ checkInsoluble (WC { wc_simple = simples })
_ -> False
definitelyNotEqual :: Role -> TcType -> TcType -> Bool
--- See Note [Fast path for tcCheckHoleFit]
+-- See Note [tcCheckHoleFit: fast insolubility check]
-- Specifically, does not need to recurse under type constructors
definitelyNotEqual r t1 t2
= go t1 t2
@@ -1041,3 +1144,46 @@ definitelyNotEqual r t1 t2
go_tc _ (FunTy {}) = True
go_tc _ (ForAllTy {}) = True
go_tc _ _ = False
+
+-- | @definitelyNotSubType cand_ty hole_ty@ computes whether @cand_ty@ is
+-- **definitely not** a subtype of @hole_ty@, in order to quickly rule out
+-- a possible hole fit candidate without having to do any solving.
+--
+-- See (FastHoles2) in Note [Speeding up valid hole-fits].
+definitelyNotSubType :: TcType -> TcType -> Bool
+definitelyNotSubType = go
+ where
+ go cand_ty hole_ty
+ -- Expand type synonyms
+ | Just cand_ty' <- coreView cand_ty
+ = go cand_ty' hole_ty
+ | Just hole_ty' <- coreView hole_ty
+ = go cand_ty hole_ty'
+
+ -- Different TyCons at the head (looking through foralls and =>).
+ | Just tc1 <- tc_head cand_ty
+ , Just tc2 <- tc_head hole_ty
+ , tc1 /= tc2
+ = True
+
+ -- Non-forall type does not fit a forall-typed hole.
+ | isSigmaTy hole_ty
+ , isTauTy cand_ty
+ = True
+
+ | otherwise
+ = False
+
+ -- Is this Type a TyConApp, after looking under foralls and =>?
+ -- If so, return the TyCon at the head.
+ tc_head :: Type -> Maybe TyCon
+ tc_head (FunTy { ft_af = af, ft_res = res })
+ | not $ isVisibleFunArg af
+ = tc_head res
+ | otherwise
+ = Just $ funTyFlagTyCon af
+ tc_head (TyConApp tc _)
+ = Just tc
+ tc_head (ForAllTy _ body)
+ = tc_head body
+ tc_head _ = Nothing
=====================================
compiler/GHC/Tc/Errors/Hole/FitTypes.hs
=====================================
@@ -19,6 +19,7 @@ import GHC.Types.Name
import GHC.Data.Bag
import Data.Function ( on )
+import qualified Data.Semigroup as S
data TypedHole = TypedHole { th_relevant_cts :: Bag CtEvidence
-- ^ Any relevant Cts to the hole
@@ -77,15 +78,15 @@ instance Ord HoleFitCandidate where
-- and the refinement level of the fit, which is the number of extra argument
-- holes that this fit uses (e.g. if hfRefLvl is 2, the fit is for `Id _ _`).
data TcHoleFit =
- HoleFit { hfId :: Id -- ^ The elements id in the TcM
- , hfCand :: HoleFitCandidate -- ^ The candidate that was checked.
- , hfType :: TcType -- ^ The type of the id, possibly zonked.
- , hfRefLvl :: Int -- ^ The number of holes in this fit.
- , hfWrap :: [TcType] -- ^ The wrapper for the match.
+ HoleFit { hfName :: Name -- ^ The name of the hole fit identifier
+ , hfCand :: HoleFitCandidate -- ^ The candidate that was checked
+ , hfType :: TcType -- ^ The type of the hole fit (possibly zonked)
+ , hfRefLvl :: Int -- ^ The number of holes in this fit
+ , hfWrap :: [TcType] -- ^ The wrapper for the match
, hfMatches :: [TcType]
-- ^ What the refinement variables got matched with, if anything
, hfDoc :: Maybe [HsDocString]
- -- ^ Documentation of this HoleFit, if available.
+ -- ^ Documentation of this HoleFit, if available
}
data HoleFit
@@ -96,30 +97,25 @@ data HoleFit
-- We define an Eq and Ord instance to be able to build a graph.
instance Eq TcHoleFit where
- (==) = (==) `on` hfId
+ (==) = (==) `on` hfName
instance Outputable HoleFit where
ppr (TcHoleFit hf) = ppr hf
ppr (RawHoleFit sd) = sd
instance Outputable TcHoleFit where
- ppr (HoleFit _ cand ty _ _ mtchs _) =
- hang (name <+> holes) 2 (text "where" <+> name <+> dcolon <+> (ppr ty))
- where name = ppr $ getName cand
- holes = sep $ map (parens . (text "_" <+> dcolon <+>) . ppr) mtchs
-
--- We compare HoleFits by their name instead of their Id, since we don't
--- want our tests to be affected by the non-determinism of `nonDetCmpVar`,
--- which is used to compare Ids. When comparing, we want HoleFits with a lower
--- refinement level to come first.
+ ppr (HoleFit { hfName = cand, hfType = ty, hfMatches = mtchs }) =
+ hang (ppr cand <+> holes) 2 (text "where" <+> ppr cand <+> dcolon <+> (ppr ty))
+ where holes = sep $ map (parens . (text "_" <+> dcolon <+>) . ppr) mtchs
+
+-- | Compare HoleFits by their 'Name'. Use 'stableNameCmp' to avoid non-determinism.
+--
+-- When comparing, we want HoleFits with a lower refinement level to come first.
instance Ord TcHoleFit where
--- compare (RawHoleFit _) (RawHoleFit _) = EQ
--- compare (RawHoleFit _) _ = LT
--- compare _ (RawHoleFit _) = GT
- compare a@(HoleFit {}) b@(HoleFit {}) = cmp a b
- where cmp = if hfRefLvl a == hfRefLvl b
- then compare `on` (getName . hfCand)
- else compare `on` hfRefLvl
+ compare a@(HoleFit {}) b@(HoleFit {}) =
+ compare (hfRefLvl a) (hfRefLvl b)
+ S.<>
+ stableNameCmp (hfName a) (hfName b)
hfIsLcl :: TcHoleFit -> Bool
hfIsLcl hf@(HoleFit {}) = case hfCand hf of
=====================================
compiler/GHC/Tc/Errors/Ppr.hs
=====================================
@@ -3595,7 +3595,7 @@ pprHoleFit :: HoleFitDispConfig -> HoleFit -> SDoc
pprHoleFit _ (RawHoleFit sd) = sd
pprHoleFit (HFDC sWrp sWrpVars sTy sProv sMs) (TcHoleFit (HoleFit {..})) =
hang display 2 provenance
- where tyApp = sep $ zipWithEqual pprArg vars hfWrap
+ where tyApp = sep $ zipWith pprArg vars hfWrap
where pprArg b arg = case binderFlag b of
Specified -> text "@" <> pprParendType arg
-- Do not print type application for inferred
@@ -3604,20 +3604,9 @@ pprHoleFit (HFDC sWrp sWrpVars sTy sProv sMs) (TcHoleFit (HoleFit {..})) =
Required -> pprPanic "pprHoleFit: bad Required"
(ppr b <+> ppr arg)
tyAppVars = sep $ punctuate comma $
- zipWithEqual (\v t -> ppr (binderVar v) <+> text "~" <+> pprParendType t)
+ zipWith (\v t -> ppr (binderVar v) <+> text "~" <+> pprParendType t)
vars hfWrap
-
- vars = unwrapTypeVars hfType
- where
- -- Attempts to get all the quantified type variables in a type,
- -- e.g.
- -- return :: forall (m :: * -> *) Monad m => (forall a . a -> m a)
- -- into [m, a]
- unwrapTypeVars :: Type -> [ForAllTyBinder]
- unwrapTypeVars t = vars ++ case splitFunTy_maybe unforalled of
- Just (_, _, _, unfunned) -> unwrapTypeVars unfunned
- _ -> []
- where (vars, unforalled) = splitForAllForAllTyBinders t
+ vars = deepInvisTvBinders hfType
holeVs = sep $ map (parens . (text "_" <+> dcolon <+>) . ppr) hfMatches
holeDisp = if sMs then holeVs
else sep $ replicate (length hfMatches) $ text "_"
@@ -3644,6 +3633,18 @@ pprHoleFit (HFDC sWrp sWrpVars sTy sProv sMs) (TcHoleFit (HoleFit {..})) =
NameHFCand name -> text "bound at" <+> ppr (getSrcLoc name)
IdHFCand id_ -> text "bound at" <+> ppr (getSrcLoc id_)
+-- | Similar to 'tcDeepSplitSigmaTy_maybe', but just cares about the binders.
+deepInvisTvBinders :: TcSigmaType -> [ForAllTyBinder]
+deepInvisTvBinders = go
+ where
+ go ty | Just (_arg_ty, res_ty) <- tcSplitFunTy_maybe ty
+ = go res_ty
+ | (tvs, body) <- splitForAllForAllTyBinders ty
+ , not (null tvs)
+ = tvs ++ go body
+ | otherwise
+ = []
+
-- | Add a "Constraints include..." message.
--
-- See Note [Constraints include ...]
=====================================
compiler/GHC/Tc/Gen/App.hs
=====================================
@@ -420,20 +420,6 @@ quickLookResultType :: TcRhoType -> ExpRhoType -> TcM ()
quickLookResultType app_res_rho (Check exp_rho) = qlUnify app_res_rho exp_rho
quickLookResultType _ _ = return ()
--- | Variant of 'getDeepSubsumptionFlag' which enables a top-level subsumption
--- in order to implement the plan of Note [Typechecking data constructors].
-getDeepSubsumptionFlag_DataConHead :: HsExpr GhcTc -> TcM DeepSubsumptionFlag
-getDeepSubsumptionFlag_DataConHead app_head =
- do { user_ds <- xoptM LangExt.DeepSubsumption
- ; return $
- if | user_ds
- -> Deep DeepSub
- | XExpr (ConLikeTc (RealDataCon {})) <- app_head
- -> Deep TopSub
- | otherwise
- -> Shallow
- }
-
finishApp :: (HsExpr GhcTc, AppCtxt) -> [HsExprArg 'TcpTc]
-> TcRhoType -> HsWrapper
-> TcM (HsExpr GhcTc)
=====================================
compiler/GHC/Tc/Utils/Unify.hs
=====================================
@@ -11,7 +11,7 @@
module GHC.Tc.Utils.Unify (
-- Full-blown subsumption
tcWrapResult, tcWrapResultO, tcWrapResultMono,
- tcSubType, tcSubTypeSigma, tcSubTypePat, tcSubTypeDS,
+ tcSubType, tcSubTypeSigma, tcSubTypePat, tcSubTypeDS, tcSubTypeHoleFit,
addSubTypeCtxt,
tcSubTypeAmbiguity, tcSubMult,
checkConstraints, checkTvConstraints,
@@ -19,7 +19,7 @@ module GHC.Tc.Utils.Unify (
-- Skolemisation
DeepSubsumptionFlag(..), DeepSubsumptionDepth(..),
- getDeepSubsumptionFlag,
+ getDeepSubsumptionFlag, getDeepSubsumptionFlag_DataConHead,
isRhoTyDS,
tcSkolemise, tcSkolemiseCompleteSig, tcSkolemiseExpectedType,
@@ -77,6 +77,7 @@ import GHC.Tc.Utils.TcMType qualified as TcM
import GHC.Tc.Solver.InertSet
+import GHC.Core.ConLike (ConLike(..))
import GHC.Core.Type
import GHC.Core.TyCo.Rep hiding (Refl)
import GHC.Core.TyCo.FVs( isInjectiveInType )
@@ -1485,6 +1486,16 @@ tcSubTypeSigma :: CtOrigin -- where did the actual type arise / why are we
tcSubTypeSigma orig ctxt ty_actual ty_expected
= tc_sub_type (unifyType Nothing) orig ctxt ty_actual ty_expected
+tcSubTypeHoleFit :: DeepSubsumptionFlag
+ -> CtOrigin
+ -> TcSigmaType -- ^ Candidate expression type
+ -> TcSigmaType -- ^ Expected type (= hole type)
+ -> TcM HsWrapper
+tcSubTypeHoleFit ds_flag orig cand_ty hole_ty =
+ -- See Note [Deep subsumption in tcCheckHoleFit]
+ tc_sub_type_ds (Nothing, Top) ds_flag (unifyType Nothing)
+ orig (ExprSigCtxt NoRRC) cand_ty hole_ty
+
---------------
tcSubTypeAmbiguity :: UserTypeCtxt -- Where did this type arise
-> TcSigmaType -> TcSigmaType -> TcM HsWrapper
@@ -2015,6 +2026,20 @@ getDeepSubsumptionFlag =
else return Shallow
}
+-- | Variant of 'getDeepSubsumptionFlag' which enables a top-level subsumption
+-- in order to implement the plan of Note [Typechecking data constructors].
+getDeepSubsumptionFlag_DataConHead :: HsExpr GhcTc -> TcM DeepSubsumptionFlag
+getDeepSubsumptionFlag_DataConHead app_head =
+ do { user_ds <- xoptM LangExt.DeepSubsumption
+ ; return $
+ if | user_ds
+ -> Deep DeepSub
+ | XExpr (ConLikeTc (RealDataCon {})) <- app_head
+ -> Deep TopSub
+ | otherwise
+ -> Shallow
+ }
+
-- | 'tc_sub_type_deep' is where the actual work happens for deep subsumption.
--
-- Given @ty_actual@ (a sigma-type) and @ty_expected@ (deeply skolemised, i.e.
=====================================
docs/users_guide/9.16.1-notes.rst
=====================================
@@ -42,6 +42,9 @@ Compiler
bound to variables. The very similar pattern ``Foo{bar = Bar{baz = 42}}``
will will not yet mark ``bar`` or ``baz`` as covered.
+- Pattern synonyms can now be suggested as valid hole fits (except, of course,
+ if they are unidirectional).
+
- When multiple ``-msse*`` flags are given, the maximum version takes effect.
For example, ``-msse4.2 -msse2`` is now equivalent to ``-msse4.2``.
Previously, only the last flag took effect.
@@ -52,6 +55,7 @@ Compiler
in addition to :ghc-flag:`-mavx2`.
Refer to the users' guide for more details about each individual flag.
+
GHCi
~~~~
=====================================
testsuite/tests/ghci/scripts/T8353.stderr
=====================================
@@ -1,4 +1,3 @@
-
Defer03.hs:4:5: warning: [GHC-83865] [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match expected type ‘Int’ with actual type ‘Char’
• In the expression: 'p'
@@ -9,8 +8,8 @@ Defer03.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
• In an equation for ‘f’: f = _
• Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
Valid hole fits include
- f :: Int (bound at Defer03.hs:7:1)
a :: Int (defined at Defer03.hs:4:1)
+ f :: Int (bound at Defer03.hs:7:1)
maxBound :: forall a. Bounded a => a
with maxBound @Int
(imported from ‘Prelude’
@@ -30,8 +29,8 @@ Defer03.hs:7:5: error: [GHC-88464]
• In an equation for ‘f’: f = _
• Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
Valid hole fits include
- f :: Int (bound at Defer03.hs:7:1)
a :: Int (defined at Defer03.hs:4:1)
+ f :: Int (bound at Defer03.hs:7:1)
maxBound :: forall a. Bounded a => a
with maxBound @Int
(imported from ‘Prelude’
@@ -51,8 +50,8 @@ Defer03.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
• In an equation for ‘f’: f = _
• Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
Valid hole fits include
- f :: Int (bound at Defer03.hs:7:1)
a :: Int (defined at Defer03.hs:4:1)
+ f :: Int (bound at Defer03.hs:7:1)
maxBound :: forall a. Bounded a => a
with maxBound @Int
(imported from ‘Prelude’
@@ -72,8 +71,8 @@ Defer03.hs:7:5: error: [GHC-88464]
• In an equation for ‘f’: f = _
• Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
Valid hole fits include
- f :: Int (bound at Defer03.hs:7:1)
a :: Int (defined at Defer03.hs:4:1)
+ f :: Int (bound at Defer03.hs:7:1)
maxBound :: forall a. Bounded a => a
with maxBound @Int
(imported from ‘Prelude’
@@ -93,8 +92,8 @@ Defer03.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
• In an equation for ‘f’: f = _
• Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
Valid hole fits include
- f :: Int (bound at Defer03.hs:7:1)
a :: Int (defined at Defer03.hs:4:1)
+ f :: Int (bound at Defer03.hs:7:1)
maxBound :: forall a. Bounded a => a
with maxBound @Int
(imported from ‘Prelude’
=====================================
testsuite/tests/overloadedrecflds/should_fail/DRFHoleFits.stderr
=====================================
@@ -1,4 +1,3 @@
-
DRFHoleFits.hs:7:7: error: [GHC-88464]
• Found hole: _ :: T -> Int
• In the expression: _ :: T -> Int
@@ -6,8 +5,8 @@ DRFHoleFits.hs:7:7: error: [GHC-88464]
• Relevant bindings include
bar :: T -> Int (bound at DRFHoleFits.hs:7:1)
Valid hole fits include
- foo :: T -> Int (defined at DRFHoleFits.hs:5:16)
bar :: T -> Int (defined at DRFHoleFits.hs:7:1)
+ foo :: T -> Int (defined at DRFHoleFits.hs:5:16)
DRFHoleFits.hs:8:7: error: [GHC-88464]
• Found hole: _ :: A.S -> Int
@@ -20,3 +19,4 @@ DRFHoleFits.hs:8:7: error: [GHC-88464]
A.foo :: A.S -> Int
(imported qualified from ‘DRFHoleFits_A’ at DRFHoleFits.hs:3:1-35
(and originally defined at DRFHoleFits_A.hs:5:16-18))
+
=====================================
testsuite/tests/perf/compiler/hard_hole_fits.stderr
=====================================
@@ -299,10 +299,10 @@ hard_hole_fits.hs:29:35: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
(bound at hard_hole_fits.hs:29:21)
testMe :: HsExpr GhcPs -> Int (bound at hard_hole_fits.hs:14:1)
Valid hole fits include
- n :: Language.Haskell.Syntax.Basic.ConTag
- (bound at hard_hole_fits.hs:29:25)
i :: Language.Haskell.Syntax.Basic.SumWidth
(bound at hard_hole_fits.hs:29:27)
+ n :: Language.Haskell.Syntax.Basic.ConTag
+ (bound at hard_hole_fits.hs:29:25)
maxBound :: forall a. Bounded a => a
with maxBound @Int
(imported from ‘Prelude’
=====================================
testsuite/tests/plugins/test-hole-plugin.stderr
=====================================
@@ -1,4 +1,3 @@
-
test-hole-plugin.hs:12:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
• Found hole: _too_long :: [Int] -> Int
Or perhaps ‘_too_long’ is mis-spelled, or not in scope
@@ -14,11 +13,11 @@ test-hole-plugin.hs:13:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
• Relevant bindings include
j :: [Int] -> Int (bound at test-hole-plugin.hs:13:1)
Valid hole fits include
- j :: [Int] -> Int
f :: [Int] -> Int
- i :: [Int] -> Int
g :: [Int] -> Int
h :: [Int] -> Int
+ i :: [Int] -> Int
+ j :: [Int] -> Int
head :: forall a. GHC.Internal.Stack.Types.HasCallStack => [a] -> a
(Some hole fits suppressed; use -fmax-valid-hole-fits=N or -fno-max-valid-hole-fits)
@@ -59,3 +58,4 @@ test-hole-plugin.hs:16:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
minimum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
product :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
+
=====================================
testsuite/tests/th/T15321.stderr
=====================================
@@ -6,7 +6,7 @@ T15321.hs:9:9: error: [GHC-88464]
fail :: forall (m :: * -> *) a.
(MonadFail m, GHC.Internal.Stack.Types.HasCallStack) =>
String -> m a
- with fail @GHC.Internal.TH.Monad.Q @GHC.Internal.TH.Syntax.Exp
+ with fail @GHC.Internal.TH.Monad.Q
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Control.Monad.Fail’))
=====================================
testsuite/tests/typecheck/should_compile/T13050.stderr
=====================================
@@ -7,13 +7,9 @@ T13050.hs:4:9: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
x :: Int (bound at T13050.hs:4:3)
f :: Int -> Int -> Int (bound at T13050.hs:4:1)
Valid hole fits include
- f :: Int -> Int -> Int (bound at T13050.hs:4:1)
g :: Int -> Int -> Int (bound at T13050.hs:5:1)
q :: Int -> Int -> Int (bound at T13050.hs:6:1)
- (-) :: forall a. Num a => a -> a -> a
- with (-) @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Num’))
+ f :: Int -> Int -> Int (bound at T13050.hs:4:1)
asTypeOf :: forall a. a -> a -> a
with asTypeOf @Int
(imported from ‘Prelude’
@@ -22,22 +18,6 @@ T13050.hs:4:9: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with const @Int @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- subtract :: forall a. Num a => a -> a -> a
- with subtract @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Num’))
- (^) :: forall a b. (Num a, Integral b) => a -> b -> a
- with (^) @Int @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
- gcd :: forall a. Integral a => a -> a -> a
- with gcd @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
- lcm :: forall a. Integral a => a -> a -> a
- with lcm @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
max :: forall a. Ord a => a -> a -> a
with max @Int
(imported from ‘Prelude’
@@ -54,10 +34,30 @@ T13050.hs:4:9: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with (+) @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Num’))
+ (-) :: forall a. Num a => a -> a -> a
+ with (-) @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Num’))
+ subtract :: forall a. Num a => a -> a -> a
+ with subtract @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Num’))
+ (^) :: forall a b. (Num a, Integral b) => a -> b -> a
+ with (^) @Int @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
div :: forall a. Integral a => a -> a -> a
with div @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Real’))
+ gcd :: forall a. Integral a => a -> a -> a
+ with gcd @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
+ lcm :: forall a. Integral a => a -> a -> a
+ with lcm @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
mod :: forall a. Integral a => a -> a -> a
with mod @Int
(imported from ‘Prelude’
@@ -74,12 +74,12 @@ T13050.hs:4:9: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with seq @Int @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Prim’))
- return :: forall (m :: * -> *) a. Monad m => a -> m a
- with return @((->) Int) @Int
+ pure :: forall (f :: * -> *) a. Applicative f => a -> f a
+ with pure @((->) Int)
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- pure :: forall (f :: * -> *) a. Applicative f => a -> f a
- with pure @((->) Int) @Int
+ return :: forall (m :: * -> *) a. Monad m => a -> m a
+ with return @((->) Int)
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
@@ -92,13 +92,9 @@ T13050.hs:5:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
x :: Int (bound at T13050.hs:5:3)
g :: Int -> Int -> Int (bound at T13050.hs:5:1)
Valid hole fits include
- g :: Int -> Int -> Int (bound at T13050.hs:5:1)
f :: Int -> Int -> Int (defined at T13050.hs:4:1)
q :: Int -> Int -> Int (bound at T13050.hs:6:1)
- (-) :: forall a. Num a => a -> a -> a
- with (-) @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Num’))
+ g :: Int -> Int -> Int (bound at T13050.hs:5:1)
asTypeOf :: forall a. a -> a -> a
with asTypeOf @Int
(imported from ‘Prelude’
@@ -107,22 +103,6 @@ T13050.hs:5:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with const @Int @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- subtract :: forall a. Num a => a -> a -> a
- with subtract @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Num’))
- (^) :: forall a b. (Num a, Integral b) => a -> b -> a
- with (^) @Int @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
- gcd :: forall a. Integral a => a -> a -> a
- with gcd @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
- lcm :: forall a. Integral a => a -> a -> a
- with lcm @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
max :: forall a. Ord a => a -> a -> a
with max @Int
(imported from ‘Prelude’
@@ -139,10 +119,30 @@ T13050.hs:5:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with (+) @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Num’))
+ (-) :: forall a. Num a => a -> a -> a
+ with (-) @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Num’))
+ subtract :: forall a. Num a => a -> a -> a
+ with subtract @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Num’))
+ (^) :: forall a b. (Num a, Integral b) => a -> b -> a
+ with (^) @Int @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
div :: forall a. Integral a => a -> a -> a
with div @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Real’))
+ gcd :: forall a. Integral a => a -> a -> a
+ with gcd @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
+ lcm :: forall a. Integral a => a -> a -> a
+ with lcm @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
mod :: forall a. Integral a => a -> a -> a
with mod @Int
(imported from ‘Prelude’
@@ -159,12 +159,12 @@ T13050.hs:5:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with seq @Int @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Prim’))
- return :: forall (m :: * -> *) a. Monad m => a -> m a
- with return @((->) Int) @Int
+ pure :: forall (f :: * -> *) a. Applicative f => a -> f a
+ with pure @((->) Int)
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- pure :: forall (f :: * -> *) a. Applicative f => a -> f a
- with pure @((->) Int) @Int
+ return :: forall (m :: * -> *) a. Monad m => a -> m a
+ with return @((->) Int)
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
@@ -178,13 +178,9 @@ T13050.hs:6:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
x :: Int (bound at T13050.hs:6:3)
q :: Int -> Int -> Int (bound at T13050.hs:6:1)
Valid hole fits include
- q :: Int -> Int -> Int (bound at T13050.hs:6:1)
f :: Int -> Int -> Int (defined at T13050.hs:4:1)
g :: Int -> Int -> Int (defined at T13050.hs:5:1)
- (-) :: forall a. Num a => a -> a -> a
- with (-) @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Num’))
+ q :: Int -> Int -> Int (bound at T13050.hs:6:1)
asTypeOf :: forall a. a -> a -> a
with asTypeOf @Int
(imported from ‘Prelude’
@@ -193,22 +189,6 @@ T13050.hs:6:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with const @Int @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- subtract :: forall a. Num a => a -> a -> a
- with subtract @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Num’))
- (^) :: forall a b. (Num a, Integral b) => a -> b -> a
- with (^) @Int @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
- gcd :: forall a. Integral a => a -> a -> a
- with gcd @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
- lcm :: forall a. Integral a => a -> a -> a
- with lcm @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
max :: forall a. Ord a => a -> a -> a
with max @Int
(imported from ‘Prelude’
@@ -225,10 +205,30 @@ T13050.hs:6:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with (+) @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Num’))
+ (-) :: forall a. Num a => a -> a -> a
+ with (-) @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Num’))
+ subtract :: forall a. Num a => a -> a -> a
+ with subtract @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Num’))
+ (^) :: forall a b. (Num a, Integral b) => a -> b -> a
+ with (^) @Int @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
div :: forall a. Integral a => a -> a -> a
with div @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Real’))
+ gcd :: forall a. Integral a => a -> a -> a
+ with gcd @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
+ lcm :: forall a. Integral a => a -> a -> a
+ with lcm @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
mod :: forall a. Integral a => a -> a -> a
with mod @Int
(imported from ‘Prelude’
@@ -245,12 +245,12 @@ T13050.hs:6:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with seq @Int @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Prim’))
- return :: forall (m :: * -> *) a. Monad m => a -> m a
- with return @((->) Int) @Int
+ pure :: forall (f :: * -> *) a. Applicative f => a -> f a
+ with pure @((->) Int)
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- pure :: forall (f :: * -> *) a. Applicative f => a -> f a
- with pure @((->) Int) @Int
+ return :: forall (m :: * -> *) a. Monad m => a -> m a
+ with return @((->) Int)
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
=====================================
testsuite/tests/typecheck/should_compile/T14273.stderr
=====================================
@@ -28,27 +28,27 @@ T14273.hs:7:32: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
pleaseShow :: Bool -> a -> Maybe String (bound at T14273.hs:6:1)
Constraints include Show a (from T14273.hs:5:1-49)
Valid hole fits include
- a :: a (bound at T14273.hs:7:17)
k :: String (bound at T14273.hs:10:1)
+ a :: a (bound at T14273.hs:7:17)
otherwise :: Bool
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- False :: Bool
+ EQ :: Ordering
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Types’))
- True :: Bool
+ GT :: Ordering
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Types’))
LT :: Ordering
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Types’))
- EQ :: Ordering
+ () :: () (bound at <wired into compiler>)
+ False :: Bool
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Types’))
- GT :: Ordering
+ True :: Bool
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Types’))
- () :: () (bound at <wired into compiler>)
pi :: forall a. Floating a => a
with pi @Double
(imported from ‘Prelude’
=====================================
testsuite/tests/typecheck/should_compile/T14590.stderr
=====================================
@@ -8,14 +8,10 @@ T14590.hs:4:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
x :: Int (bound at T14590.hs:4:4)
f1 :: Int -> Int -> Int (bound at T14590.hs:4:1)
Valid hole fits include
- f1 :: Int -> Int -> Int (bound at T14590.hs:4:1)
f2 :: Int -> Int -> Int (bound at T14590.hs:5:1)
f3 :: Int -> Int -> Int (bound at T14590.hs:6:1)
f4 :: Int -> Int -> Int (bound at T14590.hs:7:1)
- (-) :: forall a. Num a => a -> a -> a
- with (-) @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Num’))
+ f1 :: Int -> Int -> Int (bound at T14590.hs:4:1)
asTypeOf :: forall a. a -> a -> a
with asTypeOf @Int
(imported from ‘Prelude’
@@ -24,22 +20,6 @@ T14590.hs:4:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with const @Int @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- subtract :: forall a. Num a => a -> a -> a
- with subtract @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Num’))
- (^) :: forall a b. (Num a, Integral b) => a -> b -> a
- with (^) @Int @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
- gcd :: forall a. Integral a => a -> a -> a
- with gcd @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
- lcm :: forall a. Integral a => a -> a -> a
- with lcm @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
max :: forall a. Ord a => a -> a -> a
with max @Int
(imported from ‘Prelude’
@@ -56,10 +36,30 @@ T14590.hs:4:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with (+) @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Num’))
+ (-) :: forall a. Num a => a -> a -> a
+ with (-) @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Num’))
+ subtract :: forall a. Num a => a -> a -> a
+ with subtract @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Num’))
+ (^) :: forall a b. (Num a, Integral b) => a -> b -> a
+ with (^) @Int @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
div :: forall a. Integral a => a -> a -> a
with div @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Real’))
+ gcd :: forall a. Integral a => a -> a -> a
+ with gcd @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
+ lcm :: forall a. Integral a => a -> a -> a
+ with lcm @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
mod :: forall a. Integral a => a -> a -> a
with mod @Int
(imported from ‘Prelude’
@@ -76,12 +76,12 @@ T14590.hs:4:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with seq @Int @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Prim’))
- return :: forall (m :: * -> *) a. Monad m => a -> m a
- with return @((->) Int) @Int
+ pure :: forall (f :: * -> *) a. Applicative f => a -> f a
+ with pure @((->) Int)
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- pure :: forall (f :: * -> *) a. Applicative f => a -> f a
- with pure @((->) Int) @Int
+ return :: forall (m :: * -> *) a. Monad m => a -> m a
+ with return @((->) Int)
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
@@ -96,14 +96,10 @@ T14590.hs:5:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
x :: Int (bound at T14590.hs:5:4)
f2 :: Int -> Int -> Int (bound at T14590.hs:5:1)
Valid hole fits include
- f2 :: Int -> Int -> Int (bound at T14590.hs:5:1)
f1 :: Int -> Int -> Int (defined at T14590.hs:4:1)
f3 :: Int -> Int -> Int (bound at T14590.hs:6:1)
f4 :: Int -> Int -> Int (bound at T14590.hs:7:1)
- (-) :: forall a. Num a => a -> a -> a
- with (-) @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Num’))
+ f2 :: Int -> Int -> Int (bound at T14590.hs:5:1)
asTypeOf :: forall a. a -> a -> a
with asTypeOf @Int
(imported from ‘Prelude’
@@ -112,22 +108,6 @@ T14590.hs:5:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with const @Int @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- subtract :: forall a. Num a => a -> a -> a
- with subtract @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Num’))
- (^) :: forall a b. (Num a, Integral b) => a -> b -> a
- with (^) @Int @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
- gcd :: forall a. Integral a => a -> a -> a
- with gcd @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
- lcm :: forall a. Integral a => a -> a -> a
- with lcm @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
max :: forall a. Ord a => a -> a -> a
with max @Int
(imported from ‘Prelude’
@@ -144,10 +124,30 @@ T14590.hs:5:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with (+) @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Num’))
+ (-) :: forall a. Num a => a -> a -> a
+ with (-) @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Num’))
+ subtract :: forall a. Num a => a -> a -> a
+ with subtract @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Num’))
+ (^) :: forall a b. (Num a, Integral b) => a -> b -> a
+ with (^) @Int @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
div :: forall a. Integral a => a -> a -> a
with div @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Real’))
+ gcd :: forall a. Integral a => a -> a -> a
+ with gcd @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
+ lcm :: forall a. Integral a => a -> a -> a
+ with lcm @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
mod :: forall a. Integral a => a -> a -> a
with mod @Int
(imported from ‘Prelude’
@@ -164,12 +164,12 @@ T14590.hs:5:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with seq @Int @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Prim’))
- return :: forall (m :: * -> *) a. Monad m => a -> m a
- with return @((->) Int) @Int
+ pure :: forall (f :: * -> *) a. Applicative f => a -> f a
+ with pure @((->) Int)
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- pure :: forall (f :: * -> *) a. Applicative f => a -> f a
- with pure @((->) Int) @Int
+ return :: forall (m :: * -> *) a. Monad m => a -> m a
+ with return @((->) Int)
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
@@ -182,14 +182,10 @@ T14590.hs:6:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
x :: Int (bound at T14590.hs:6:4)
f3 :: Int -> Int -> Int (bound at T14590.hs:6:1)
Valid hole fits include
- f3 :: Int -> Int -> Int (bound at T14590.hs:6:1)
f1 :: Int -> Int -> Int (defined at T14590.hs:4:1)
f2 :: Int -> Int -> Int (defined at T14590.hs:5:1)
f4 :: Int -> Int -> Int (bound at T14590.hs:7:1)
- (-) :: forall a. Num a => a -> a -> a
- with (-) @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Num’))
+ f3 :: Int -> Int -> Int (bound at T14590.hs:6:1)
asTypeOf :: forall a. a -> a -> a
with asTypeOf @Int
(imported from ‘Prelude’
@@ -198,22 +194,6 @@ T14590.hs:6:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with const @Int @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- subtract :: forall a. Num a => a -> a -> a
- with subtract @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Num’))
- (^) :: forall a b. (Num a, Integral b) => a -> b -> a
- with (^) @Int @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
- gcd :: forall a. Integral a => a -> a -> a
- with gcd @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
- lcm :: forall a. Integral a => a -> a -> a
- with lcm @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
max :: forall a. Ord a => a -> a -> a
with max @Int
(imported from ‘Prelude’
@@ -230,10 +210,30 @@ T14590.hs:6:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with (+) @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Num’))
+ (-) :: forall a. Num a => a -> a -> a
+ with (-) @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Num’))
+ subtract :: forall a. Num a => a -> a -> a
+ with subtract @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Num’))
+ (^) :: forall a b. (Num a, Integral b) => a -> b -> a
+ with (^) @Int @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
div :: forall a. Integral a => a -> a -> a
with div @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Real’))
+ gcd :: forall a. Integral a => a -> a -> a
+ with gcd @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
+ lcm :: forall a. Integral a => a -> a -> a
+ with lcm @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
mod :: forall a. Integral a => a -> a -> a
with mod @Int
(imported from ‘Prelude’
@@ -250,12 +250,12 @@ T14590.hs:6:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with seq @Int @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Prim’))
- return :: forall (m :: * -> *) a. Monad m => a -> m a
- with return @((->) Int) @Int
+ pure :: forall (f :: * -> *) a. Applicative f => a -> f a
+ with pure @((->) Int)
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- pure :: forall (f :: * -> *) a. Applicative f => a -> f a
- with pure @((->) Int) @Int
+ return :: forall (m :: * -> *) a. Monad m => a -> m a
+ with return @((->) Int)
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
@@ -269,14 +269,10 @@ T14590.hs:7:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
x :: Int (bound at T14590.hs:7:4)
f4 :: Int -> Int -> Int (bound at T14590.hs:7:1)
Valid hole fits include
- f4 :: Int -> Int -> Int (bound at T14590.hs:7:1)
f1 :: Int -> Int -> Int (defined at T14590.hs:4:1)
f2 :: Int -> Int -> Int (defined at T14590.hs:5:1)
f3 :: Int -> Int -> Int (defined at T14590.hs:6:1)
- (-) :: forall a. Num a => a -> a -> a
- with (-) @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Num’))
+ f4 :: Int -> Int -> Int (bound at T14590.hs:7:1)
asTypeOf :: forall a. a -> a -> a
with asTypeOf @Int
(imported from ‘Prelude’
@@ -285,22 +281,6 @@ T14590.hs:7:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with const @Int @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- subtract :: forall a. Num a => a -> a -> a
- with subtract @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Num’))
- (^) :: forall a b. (Num a, Integral b) => a -> b -> a
- with (^) @Int @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
- gcd :: forall a. Integral a => a -> a -> a
- with gcd @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
- lcm :: forall a. Integral a => a -> a -> a
- with lcm @Int
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Real’))
max :: forall a. Ord a => a -> a -> a
with max @Int
(imported from ‘Prelude’
@@ -317,10 +297,30 @@ T14590.hs:7:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with (+) @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Num’))
+ (-) :: forall a. Num a => a -> a -> a
+ with (-) @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Num’))
+ subtract :: forall a. Num a => a -> a -> a
+ with subtract @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Num’))
+ (^) :: forall a b. (Num a, Integral b) => a -> b -> a
+ with (^) @Int @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
div :: forall a. Integral a => a -> a -> a
with div @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Real’))
+ gcd :: forall a. Integral a => a -> a -> a
+ with gcd @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
+ lcm :: forall a. Integral a => a -> a -> a
+ with lcm @Int
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Real’))
mod :: forall a. Integral a => a -> a -> a
with mod @Int
(imported from ‘Prelude’
@@ -337,12 +337,12 @@ T14590.hs:7:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with seq @Int @Int
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Prim’))
- return :: forall (m :: * -> *) a. Monad m => a -> m a
- with return @((->) Int) @Int
+ pure :: forall (f :: * -> *) a. Applicative f => a -> f a
+ with pure @((->) Int)
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- pure :: forall (f :: * -> *) a. Applicative f => a -> f a
- with pure @((->) Int) @Int
+ return :: forall (m :: * -> *) a. Monad m => a -> m a
+ with return @((->) Int)
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
=====================================
testsuite/tests/typecheck/should_compile/T25180.stderr
=====================================
@@ -29,16 +29,20 @@ T25180.hs:19:8: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
tup1 :: a -> Solo a (bound at T25180.hs:19:1)
Valid hole fits include
tup1 :: a -> Solo a (bound at T25180.hs:19:1)
+ Solo :: forall a. a -> Solo a
+ with Solo @a
+ (imported from ‘Data.Tuple’ at T25180.hs:6:1-17
+ (and originally defined in ‘GHC.Internal.Tuple’))
MkSolo :: forall a. a -> Solo a
with MkSolo @a
(imported from ‘Data.Tuple’ at T25180.hs:6:1-17
(and originally defined in ‘GHC.Internal.Tuple’))
- return :: forall (m :: * -> *) a. Monad m => a -> m a
- with return @Solo @a
+ pure :: forall (f :: * -> *) a. Applicative f => a -> f a
+ with pure @Solo
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- pure :: forall (f :: * -> *) a. Applicative f => a -> f a
- with pure @Solo @a
+ return :: forall (m :: * -> *) a. Monad m => a -> m a
+ with return @Solo
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
=====================================
testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr
=====================================
@@ -1,4 +1,3 @@
-
abstract_refinement_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: [Integer] -> Integer
• In an equation for ‘f’: f = _
@@ -6,8 +5,8 @@ abstract_refinement_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -W
f :: [Integer] -> Integer
(bound at abstract_refinement_hole_fits.hs:4:1)
Valid hole fits include
- f :: [Integer] -> Integer
g :: [Integer] -> Integer
+ f :: [Integer] -> Integer
head :: forall a. GHC.Internal.Stack.Types.HasCallStack => [a] -> a
last :: forall a. GHC.Internal.Stack.Types.HasCallStack => [a] -> a
maximum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
@@ -61,46 +60,46 @@ abstract_refinement_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -W
where fst :: forall a b. (a, b) -> a
snd (_ :: (a3, t0 -> [Integer] -> Integer)) (_ :: t0)
where snd :: forall a b. (a, b) -> b
- return (_ :: Integer)
- where return :: forall (m :: * -> *) a. Monad m => a -> m a
pure (_ :: Integer)
where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
- (>>=) (_ :: [Integer] -> a6) (_ :: a6 -> [Integer] -> Integer)
- where (>>=) :: forall (m :: * -> *) a b.
- Monad m =>
- m a -> (a -> m b) -> m b
- (>>) (_ :: [Integer] -> a5) (_ :: [Integer] -> Integer)
- where (>>) :: forall (m :: * -> *) a b.
- Monad m =>
- m a -> m b -> m b
- fmap (_ :: a7 -> Integer) (_ :: [Integer] -> a7)
- where fmap :: forall (f :: * -> *) a b.
+ return (_ :: Integer)
+ where return :: forall (m :: * -> *) a. Monad m => a -> m a
+ (*>) (_ :: [Integer] -> a8) (_ :: [Integer] -> Integer)
+ where (*>) :: forall (f :: * -> *) a b.
+ Applicative f =>
+ f a -> f b -> f b
+ (<$) (_ :: Integer) (_ :: [Integer] -> b5)
+ where (<$) :: forall (f :: * -> *) a b.
Functor f =>
- (a -> b) -> f a -> f b
+ a -> f b -> f a
+ (<*) (_ :: [Integer] -> Integer) (_ :: [Integer] -> b4)
+ where (<*) :: forall (f :: * -> *) a b.
+ Applicative f =>
+ f a -> f b -> f a
(<*>) (_ :: [Integer] -> a9 -> Integer) (_ :: [Integer] -> a9)
where (<*>) :: forall (f :: * -> *) a b.
Applicative f =>
f (a -> b) -> f a -> f b
- (*>) (_ :: [Integer] -> a8) (_ :: [Integer] -> Integer)
- where (*>) :: forall (f :: * -> *) a b.
- Applicative f =>
- f a -> f b -> f b
(=<<) (_ :: a1 -> [Integer] -> Integer) (_ :: [Integer] -> a1)
where (=<<) :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> m a -> m b
+ (>>) (_ :: [Integer] -> a5) (_ :: [Integer] -> Integer)
+ where (>>) :: forall (m :: * -> *) a b.
+ Monad m =>
+ m a -> m b -> m b
+ (>>=) (_ :: [Integer] -> a6) (_ :: a6 -> [Integer] -> Integer)
+ where (>>=) :: forall (m :: * -> *) a b.
+ Monad m =>
+ m a -> (a -> m b) -> m b
+ fmap (_ :: a7 -> Integer) (_ :: [Integer] -> a7)
+ where fmap :: forall (f :: * -> *) a b.
+ Functor f =>
+ (a -> b) -> f a -> f b
(<$>) (_ :: a2 -> Integer) (_ :: [Integer] -> a2)
where (<$>) :: forall (f :: * -> *) a b.
Functor f =>
(a -> b) -> f a -> f b
- (<*) (_ :: [Integer] -> Integer) (_ :: [Integer] -> b4)
- where (<*) :: forall (f :: * -> *) a b.
- Applicative f =>
- f a -> f b -> f a
- (<$) (_ :: Integer) (_ :: [Integer] -> b5)
- where (<$) :: forall (f :: * -> *) a b.
- Functor f =>
- a -> f b -> f a
id (_ :: [Integer] -> Integer)
where id :: forall a. a -> a
head (_ :: [[Integer] -> Integer])
@@ -125,16 +124,16 @@ abstract_refinement_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -W
where const :: forall a b. a -> b -> a
uncurry (_ :: a4 -> b3 -> [Integer] -> Integer) (_ :: (a4, b3))
where uncurry :: forall a b c. (a -> b -> c) -> (a, b) -> c
- seq (_ :: t2) (_ :: [Integer] -> Integer)
- where seq :: forall a b. a -> b -> b
($!) (_ :: t0 -> [Integer] -> Integer) (_ :: t0)
where ($!) :: forall a b. (a -> b) -> a -> b
+ seq (_ :: t2) (_ :: [Integer] -> Integer)
+ where seq :: forall a b. a -> b -> b
($) (_ :: t0 -> [Integer] -> Integer) (_ :: t0)
where ($) :: forall a b. (a -> b) -> a -> b
- return (_ :: [Integer] -> Integer) (_ :: t0)
- where return :: forall (m :: * -> *) a. Monad m => a -> m a
pure (_ :: [Integer] -> Integer) (_ :: t0)
where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
+ return (_ :: [Integer] -> Integer) (_ :: t0)
+ where return :: forall (m :: * -> *) a. Monad m => a -> m a
abstract_refinement_hole_fits.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: Integer -> [Integer] -> Integer
@@ -145,8 +144,8 @@ abstract_refinement_hole_fits.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -W
(bound at abstract_refinement_hole_fits.hs:7:1)
Valid hole fits include
const :: forall a b. a -> b -> a
- return :: forall (m :: * -> *) a. Monad m => a -> m a
pure :: forall (f :: * -> *) a. Applicative f => a -> f a
+ return :: forall (m :: * -> *) a. Monad m => a -> m a
Valid refinement hole fits include
foldl (_ :: Integer -> Integer -> Integer)
where foldl :: forall (t :: * -> *) b a.
@@ -190,49 +189,49 @@ abstract_refinement_hole_fits.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -W
where fst :: forall a b. (a, b) -> a
snd (_ :: (a3, t0 -> Integer -> [Integer] -> Integer)) (_ :: t0)
where snd :: forall a b. (a, b) -> b
- return (_ :: [Integer] -> Integer)
- where return :: forall (m :: * -> *) a. Monad m => a -> m a
pure (_ :: [Integer] -> Integer)
where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
- (>>=) (_ :: Integer -> a6)
- (_ :: a6 -> Integer -> [Integer] -> Integer)
- where (>>=) :: forall (m :: * -> *) a b.
- Monad m =>
- m a -> (a -> m b) -> m b
- (>>) (_ :: Integer -> a5) (_ :: Integer -> [Integer] -> Integer)
- where (>>) :: forall (m :: * -> *) a b.
- Monad m =>
- m a -> m b -> m b
- fmap (_ :: a7 -> [Integer] -> Integer) (_ :: Integer -> a7)
- where fmap :: forall (f :: * -> *) a b.
+ return (_ :: [Integer] -> Integer)
+ where return :: forall (m :: * -> *) a. Monad m => a -> m a
+ (*>) (_ :: Integer -> a8) (_ :: Integer -> [Integer] -> Integer)
+ where (*>) :: forall (f :: * -> *) a b.
+ Applicative f =>
+ f a -> f b -> f b
+ (<$) (_ :: [Integer] -> Integer) (_ :: Integer -> b5)
+ where (<$) :: forall (f :: * -> *) a b.
Functor f =>
- (a -> b) -> f a -> f b
+ a -> f b -> f a
+ (<*) (_ :: Integer -> [Integer] -> Integer) (_ :: Integer -> b4)
+ where (<*) :: forall (f :: * -> *) a b.
+ Applicative f =>
+ f a -> f b -> f a
(<*>) (_ :: Integer -> a9 -> [Integer] -> Integer)
(_ :: Integer -> a9)
where (<*>) :: forall (f :: * -> *) a b.
Applicative f =>
f (a -> b) -> f a -> f b
- (*>) (_ :: Integer -> a8) (_ :: Integer -> [Integer] -> Integer)
- where (*>) :: forall (f :: * -> *) a b.
- Applicative f =>
- f a -> f b -> f b
(=<<) (_ :: a1 -> Integer -> [Integer] -> Integer)
(_ :: Integer -> a1)
where (=<<) :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> m a -> m b
+ (>>) (_ :: Integer -> a5) (_ :: Integer -> [Integer] -> Integer)
+ where (>>) :: forall (m :: * -> *) a b.
+ Monad m =>
+ m a -> m b -> m b
+ (>>=) (_ :: Integer -> a6)
+ (_ :: a6 -> Integer -> [Integer] -> Integer)
+ where (>>=) :: forall (m :: * -> *) a b.
+ Monad m =>
+ m a -> (a -> m b) -> m b
+ fmap (_ :: a7 -> [Integer] -> Integer) (_ :: Integer -> a7)
+ where fmap :: forall (f :: * -> *) a b.
+ Functor f =>
+ (a -> b) -> f a -> f b
(<$>) (_ :: a2 -> [Integer] -> Integer) (_ :: Integer -> a2)
where (<$>) :: forall (f :: * -> *) a b.
Functor f =>
(a -> b) -> f a -> f b
- (<*) (_ :: Integer -> [Integer] -> Integer) (_ :: Integer -> b4)
- where (<*) :: forall (f :: * -> *) a b.
- Applicative f =>
- f a -> f b -> f a
- (<$) (_ :: [Integer] -> Integer) (_ :: Integer -> b5)
- where (<$) :: forall (f :: * -> *) a b.
- Functor f =>
- a -> f b -> f a
id (_ :: Integer -> [Integer] -> Integer)
where id :: forall a. a -> a
head (_ :: [Integer -> [Integer] -> Integer])
@@ -259,13 +258,14 @@ abstract_refinement_hole_fits.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -W
uncurry (_ :: a4 -> b3 -> Integer -> [Integer] -> Integer)
(_ :: (a4, b3))
where uncurry :: forall a b c. (a -> b -> c) -> (a, b) -> c
- seq (_ :: t2) (_ :: Integer -> [Integer] -> Integer)
- where seq :: forall a b. a -> b -> b
($!) (_ :: t0 -> Integer -> [Integer] -> Integer) (_ :: t0)
where ($!) :: forall a b. (a -> b) -> a -> b
+ seq (_ :: t2) (_ :: Integer -> [Integer] -> Integer)
+ where seq :: forall a b. a -> b -> b
($) (_ :: t0 -> Integer -> [Integer] -> Integer) (_ :: t0)
where ($) :: forall a b. (a -> b) -> a -> b
- return (_ :: Integer -> [Integer] -> Integer) (_ :: t0)
- where return :: forall (m :: * -> *) a. Monad m => a -> m a
pure (_ :: Integer -> [Integer] -> Integer) (_ :: t0)
where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
+ return (_ :: Integer -> [Integer] -> Integer) (_ :: t0)
+ where return :: forall (m :: * -> *) a. Monad m => a -> m a
+
=====================================
testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr
=====================================
@@ -1,4 +1,3 @@
-
constraint_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: [a] -> a
Where: ‘a’ is a rigid type variable bound by
@@ -42,10 +41,10 @@ constraint_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
where ($) :: forall a b. (a -> b) -> a -> b
($!) (_ :: [a] -> a)
where ($!) :: forall a b. (a -> b) -> a -> b
- return (_ :: a)
- where return :: forall (m :: * -> *) a. Monad m => a -> m a
pure (_ :: a)
where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
+ return (_ :: a)
+ where return :: forall (m :: * -> *) a. Monad m => a -> m a
id (_ :: [a] -> a)
where id :: forall a. a -> a
head (_ :: [[a] -> a])
@@ -62,3 +61,4 @@ constraint_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
where (!!) :: forall a.
GHC.Internal.Stack.Types.HasCallStack =>
[a] -> Int -> a
+
=====================================
testsuite/tests/typecheck/should_compile/free_monad_hole_fits.stderr
=====================================
@@ -1,4 +1,3 @@
-
free_monad_hole_fits.hs:14:28: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
• Found hole:
_a :: (Free f a -> Free f b) -> f (Free f a) -> f (Free f b)
@@ -55,10 +54,6 @@ free_monad_hole_fits.hs:25:31: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault
Constraints include
Applicative f (from free_monad_hole_fits.hs:22:10-40)
Valid refinement hole fits include
- fmap (_ :: a -> b)
- where fmap :: forall (f :: * -> *) a b.
- Functor f =>
- (a -> b) -> f a -> f b
(<*>) (_ :: Free f (a -> b))
where (<*>) :: forall (f :: * -> *) a b.
Applicative f =>
@@ -67,6 +62,10 @@ free_monad_hole_fits.hs:25:31: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault
where (=<<) :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> m a -> m b
+ fmap (_ :: a -> b)
+ where fmap :: forall (f :: * -> *) a b.
+ Functor f =>
+ (a -> b) -> f a -> f b
(<$>) (_ :: a -> b)
where (<$>) :: forall (f :: * -> *) a b.
Functor f =>
@@ -75,3 +74,4 @@ free_monad_hole_fits.hs:25:31: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault
where ($) :: forall a b. (a -> b) -> a -> b
pure (_ :: Free f b)
where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
+
=====================================
testsuite/tests/typecheck/should_compile/hole_constraints.stderr
=====================================
@@ -1,4 +1,3 @@
-
hole_constraints.hs:8:6: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: a
Where: ‘a’ is a rigid type variable bound by
@@ -67,8 +66,9 @@ hole_constraints.hs:27:32: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
foo :: AnyShow -> String (bound at hole_constraints.hs:27:1)
Constraints include Show a (from hole_constraints.hs:27:19-27)
Valid hole fits include
- f3 :: forall a. C a => a
f1 :: forall a. Eq a => a
f2 :: forall a. (Show a, Eq a) => a
+ f3 :: forall a. C a => a
[] :: forall a. [a]
mempty :: forall a. Monoid a => a
+
=====================================
testsuite/tests/typecheck/should_compile/holes.stderr
=====================================
@@ -40,18 +40,12 @@ holes.hs:11:15: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
y :: [a] (bound at holes.hs:11:3)
z :: [a] -> [a] (bound at holes.hs:11:1)
Valid hole fits include
- y :: [a]
- z :: [a] -> [a]
g :: Int -> Char
h :: [Char]
+ y :: [a]
+ z :: [a] -> [a]
f :: forall {p}. p
otherwise :: Bool
- False :: Bool
- True :: Bool
- LT :: Ordering
- EQ :: Ordering
- GT :: Ordering
- () :: ()
(&&) :: Bool -> Bool -> Bool
not :: Bool -> Bool
(||) :: Bool -> Bool -> Bool
@@ -74,22 +68,48 @@ holes.hs:11:15: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
putStrLn :: String -> IO ()
readFile :: FilePath -> IO String
writeFile :: FilePath -> String -> IO ()
+ EQ :: Ordering
+ GT :: Ordering
+ LT :: Ordering
+ () :: ()
+ False :: Bool
+ True :: Bool
(++) :: forall a. [a] -> [a] -> [a]
- filter :: forall a. (a -> Bool) -> [a] -> [a]
- fromInteger :: forall a. Num a => Integer -> a
- (-) :: forall a. Num a => a -> a -> a
- fromRational :: forall a. Fractional a => Rational -> a
- negate :: forall a. Num a => a -> a
- fromIntegral :: forall a b. (Integral a, Num b) => a -> b
- toInteger :: forall a. Integral a => a -> Integer
- toRational :: forall a. Real a => a -> Rational
- (:) :: forall a. a -> [a] -> [a]
- Nothing :: forall a. Maybe a
- Just :: forall a. a -> Maybe a
- [] :: forall a. [a]
asTypeOf :: forall a. a -> a -> a
id :: forall a. a -> a
until :: forall a. (a -> Bool) -> (a -> a) -> a -> a
+ (**) :: forall a. Floating a => a -> a -> a
+ acos :: forall a. Floating a => a -> a
+ acosh :: forall a. Floating a => a -> a
+ asin :: forall a. Floating a => a -> a
+ asinh :: forall a. Floating a => a -> a
+ atan :: forall a. Floating a => a -> a
+ atan2 :: forall a. RealFloat a => a -> a -> a
+ atanh :: forall a. Floating a => a -> a
+ cos :: forall a. Floating a => a -> a
+ cosh :: forall a. Floating a => a -> a
+ decodeFloat :: forall a. RealFloat a => a -> (Integer, Int)
+ encodeFloat :: forall a. RealFloat a => Integer -> Int -> a
+ exp :: forall a. Floating a => a -> a
+ exponent :: forall a. RealFloat a => a -> Int
+ floatDigits :: forall a. RealFloat a => a -> Int
+ floatRadix :: forall a. RealFloat a => a -> Integer
+ floatRange :: forall a. RealFloat a => a -> (Int, Int)
+ isDenormalized :: forall a. RealFloat a => a -> Bool
+ isIEEE :: forall a. RealFloat a => a -> Bool
+ isInfinite :: forall a. RealFloat a => a -> Bool
+ isNaN :: forall a. RealFloat a => a -> Bool
+ isNegativeZero :: forall a. RealFloat a => a -> Bool
+ log :: forall a. Floating a => a -> a
+ logBase :: forall a. Floating a => a -> a -> a
+ pi :: forall a. Floating a => a
+ scaleFloat :: forall a. RealFloat a => Int -> a -> a
+ significand :: forall a. RealFloat a => a -> a
+ sin :: forall a. Floating a => a -> a
+ sinh :: forall a. Floating a => a -> a
+ sqrt :: forall a. Floating a => a -> a
+ tan :: forall a. Floating a => a -> a
+ tanh :: forall a. Floating a => a -> a
ioError :: forall a.
GHC.Internal.Stack.Types.HasCallStack =>
IOError -> IO a
@@ -102,6 +122,7 @@ holes.hs:11:15: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
[a] -> [a]
drop :: forall a. Int -> [a] -> [a]
dropWhile :: forall a. (a -> Bool) -> [a] -> [a]
+ filter :: forall a. (a -> Bool) -> [a] -> [a]
head :: forall a. GHC.Internal.Stack.Types.HasCallStack => [a] -> a
init :: forall a.
GHC.Internal.Stack.Types.HasCallStack =>
@@ -120,80 +141,57 @@ holes.hs:11:15: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
[a] -> [a]
take :: forall a. Int -> [a] -> [a]
takeWhile :: forall a. (a -> Bool) -> [a] -> [a]
- subtract :: forall a. Num a => a -> a -> a
- readParen :: forall a. Bool -> ReadS a -> ReadS a
- (^) :: forall a b. (Num a, Integral b) => a -> b -> a
- even :: forall a. Integral a => a -> Bool
- gcd :: forall a. Integral a => a -> a -> a
- lcm :: forall a. Integral a => a -> a -> a
- odd :: forall a. Integral a => a -> Bool
- (**) :: forall a. Floating a => a -> a -> a
- acos :: forall a. Floating a => a -> a
- acosh :: forall a. Floating a => a -> a
- asin :: forall a. Floating a => a -> a
- asinh :: forall a. Floating a => a -> a
- atan :: forall a. Floating a => a -> a
- atanh :: forall a. Floating a => a -> a
- cos :: forall a. Floating a => a -> a
- cosh :: forall a. Floating a => a -> a
- exp :: forall a. Floating a => a -> a
- log :: forall a. Floating a => a -> a
- logBase :: forall a. Floating a => a -> a -> a
- pi :: forall a. Floating a => a
- sin :: forall a. Floating a => a -> a
- sinh :: forall a. Floating a => a -> a
- sqrt :: forall a. Floating a => a -> a
- tan :: forall a. Floating a => a -> a
- tanh :: forall a. Floating a => a -> a
- atan2 :: forall a. RealFloat a => a -> a -> a
- decodeFloat :: forall a. RealFloat a => a -> (Integer, Int)
- encodeFloat :: forall a. RealFloat a => Integer -> Int -> a
- exponent :: forall a. RealFloat a => a -> Int
- floatDigits :: forall a. RealFloat a => a -> Int
- floatRadix :: forall a. RealFloat a => a -> Integer
- floatRange :: forall a. RealFloat a => a -> (Int, Int)
- isDenormalized :: forall a. RealFloat a => a -> Bool
- isIEEE :: forall a. RealFloat a => a -> Bool
- isInfinite :: forall a. RealFloat a => a -> Bool
- isNaN :: forall a. RealFloat a => a -> Bool
- isNegativeZero :: forall a. RealFloat a => a -> Bool
- scaleFloat :: forall a. RealFloat a => Int -> a -> a
- significand :: forall a. RealFloat a => a -> a
(*) :: forall a. Num a => a -> a -> a
(+) :: forall a. Num a => a -> a -> a
+ (-) :: forall a. Num a => a -> a -> a
abs :: forall a. Num a => a -> a
+ fromInteger :: forall a. Num a => Integer -> a
+ negate :: forall a. Num a => a -> a
signum :: forall a. Num a => a -> a
+ subtract :: forall a. Num a => a -> a -> a
+ readParen :: forall a. Bool -> ReadS a -> ReadS a
(/) :: forall a. Fractional a => a -> a -> a
- recip :: forall a. Fractional a => a -> a
+ (^) :: forall a b. (Num a, Integral b) => a -> b -> a
div :: forall a. Integral a => a -> a -> a
divMod :: forall a. Integral a => a -> a -> (a, a)
+ even :: forall a. Integral a => a -> Bool
+ fromIntegral :: forall a b. (Integral a, Num b) => a -> b
+ fromRational :: forall a. Fractional a => Rational -> a
+ gcd :: forall a. Integral a => a -> a -> a
+ lcm :: forall a. Integral a => a -> a -> a
mod :: forall a. Integral a => a -> a -> a
+ odd :: forall a. Integral a => a -> Bool
quot :: forall a. Integral a => a -> a -> a
quotRem :: forall a. Integral a => a -> a -> (a, a)
+ recip :: forall a. Fractional a => a -> a
rem :: forall a. Integral a => a -> a -> a
- zip :: forall a b. [a] -> [b] -> [(a, b)]
+ toInteger :: forall a. Integral a => a -> Integer
+ toRational :: forall a. Real a => a -> Rational
+ Just :: forall a. a -> Maybe a
+ Nothing :: forall a. Maybe a
+ (:) :: forall a. a -> [a] -> [a]
+ [] :: forall a. [a]
+ const :: forall a b. a -> b -> a
map :: forall a b. (a -> b) -> [a] -> [b]
- realToFrac :: forall a b. (Real a, Fractional b) => a -> b
Left :: forall a b. a -> Either a b
Right :: forall a b. b -> Either a b
- (,) :: forall a b. a -> b -> (a, b)
- const :: forall a b. a -> b -> a
maybe :: forall b a. b -> (a -> b) -> Maybe a -> b
fst :: forall a b. (a, b) -> a
snd :: forall a b. (a, b) -> b
scanl :: forall b a. (b -> a -> b) -> b -> [a] -> [b]
scanr :: forall a b. (a -> b -> b) -> b -> [a] -> [b]
unzip :: forall a b. [(a, b)] -> ([a], [b])
+ zip :: forall a b. [a] -> [b] -> [(a, b)]
(^^) :: forall a b. (Fractional a, Integral b) => a -> b -> a
ceiling :: forall a b. (RealFrac a, Integral b) => a -> b
floor :: forall a b. (RealFrac a, Integral b) => a -> b
properFraction :: forall a b.
(RealFrac a, Integral b) =>
a -> (b, a)
+ realToFrac :: forall a b. (Real a, Fractional b) => a -> b
round :: forall a b. (RealFrac a, Integral b) => a -> b
truncate :: forall a b. (RealFrac a, Integral b) => a -> b
- seq :: forall a b. a -> b -> b
- (,,) :: forall a b c. a -> b -> c -> (a, b, c)
+ (,) :: forall a b. a -> b -> (a, b)
($!) :: forall a b. (a -> b) -> a -> b
(.) :: forall b c a. (b -> c) -> (a -> b) -> a -> c
either :: forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
@@ -202,11 +200,13 @@ holes.hs:11:15: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
unzip3 :: forall a b c. [(a, b, c)] -> ([a], [b], [c])
zip3 :: forall a b c. [a] -> [b] -> [c] -> [(a, b, c)]
zipWith :: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
+ seq :: forall a b. a -> b -> b
+ (,,) :: forall a b c. a -> b -> c -> (a, b, c)
($) :: forall a b. (a -> b) -> a -> b
- (,,,) :: forall a b c d. a -> b -> c -> d -> (a, b, c, d)
flip :: forall a b c. (a -> b -> c) -> b -> a -> c
zipWith3 :: forall a b c d.
(a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ (,,,) :: forall a b c d. a -> b -> c -> d -> (a, b, c, d)
(,,,,) :: forall a b c d e.
a -> b -> c -> d -> e -> (a, b, c, d, e)
(,,,,,) :: forall a b c d e f.
=====================================
testsuite/tests/typecheck/should_compile/holes2.stderr
=====================================
@@ -1,4 +1,3 @@
-
holes2.hs:3:5: warning: [GHC-39999] [-Wdeferred-type-errors (in -Wdefault)]
• Ambiguous type variable ‘a0’ arising from a use of ‘show’
prevents the constraint ‘(Show a0)’ from being solved.
@@ -8,7 +7,7 @@ holes2.hs:3:5: warning: [GHC-39999] [-Wdeferred-type-errors (in -Wdefault)]
-- Defined in ‘GHC.Internal.Data.Either’
instance Show Ordering -- Defined in ‘GHC.Internal.Show’
...plus 26 others
- ...plus 48 instances involving out-of-scope types
+ ...plus 49 instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the expression: show _
In an equation for ‘f’: f = show _
@@ -23,10 +22,11 @@ holes2.hs:3:10: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
Valid hole fits include
f :: String
otherwise :: Bool
- False :: Bool
- True :: Bool
- LT :: Ordering
EQ :: Ordering
GT :: Ordering
+ LT :: Ordering
() :: ()
+ False :: Bool
+ True :: Bool
pi :: forall a. Floating a => a
+
=====================================
testsuite/tests/typecheck/should_compile/holes3.stderr
=====================================
@@ -43,18 +43,12 @@ holes3.hs:11:15: error: [GHC-88464]
y :: [a] (bound at holes3.hs:11:3)
z :: [a] -> [a] (bound at holes3.hs:11:1)
Valid hole fits include
- y :: [a]
- z :: [a] -> [a]
g :: Int -> Char
h :: [Char]
+ y :: [a]
+ z :: [a] -> [a]
f :: forall {p}. p
otherwise :: Bool
- False :: Bool
- True :: Bool
- LT :: Ordering
- EQ :: Ordering
- GT :: Ordering
- () :: ()
(&&) :: Bool -> Bool -> Bool
not :: Bool -> Bool
(||) :: Bool -> Bool -> Bool
@@ -77,22 +71,48 @@ holes3.hs:11:15: error: [GHC-88464]
putStrLn :: String -> IO ()
readFile :: FilePath -> IO String
writeFile :: FilePath -> String -> IO ()
+ EQ :: Ordering
+ GT :: Ordering
+ LT :: Ordering
+ () :: ()
+ False :: Bool
+ True :: Bool
(++) :: forall a. [a] -> [a] -> [a]
- filter :: forall a. (a -> Bool) -> [a] -> [a]
- fromInteger :: forall a. Num a => Integer -> a
- (-) :: forall a. Num a => a -> a -> a
- fromRational :: forall a. Fractional a => Rational -> a
- negate :: forall a. Num a => a -> a
- fromIntegral :: forall a b. (Integral a, Num b) => a -> b
- toInteger :: forall a. Integral a => a -> Integer
- toRational :: forall a. Real a => a -> Rational
- (:) :: forall a. a -> [a] -> [a]
- Nothing :: forall a. Maybe a
- Just :: forall a. a -> Maybe a
- [] :: forall a. [a]
asTypeOf :: forall a. a -> a -> a
id :: forall a. a -> a
until :: forall a. (a -> Bool) -> (a -> a) -> a -> a
+ (**) :: forall a. Floating a => a -> a -> a
+ acos :: forall a. Floating a => a -> a
+ acosh :: forall a. Floating a => a -> a
+ asin :: forall a. Floating a => a -> a
+ asinh :: forall a. Floating a => a -> a
+ atan :: forall a. Floating a => a -> a
+ atan2 :: forall a. RealFloat a => a -> a -> a
+ atanh :: forall a. Floating a => a -> a
+ cos :: forall a. Floating a => a -> a
+ cosh :: forall a. Floating a => a -> a
+ decodeFloat :: forall a. RealFloat a => a -> (Integer, Int)
+ encodeFloat :: forall a. RealFloat a => Integer -> Int -> a
+ exp :: forall a. Floating a => a -> a
+ exponent :: forall a. RealFloat a => a -> Int
+ floatDigits :: forall a. RealFloat a => a -> Int
+ floatRadix :: forall a. RealFloat a => a -> Integer
+ floatRange :: forall a. RealFloat a => a -> (Int, Int)
+ isDenormalized :: forall a. RealFloat a => a -> Bool
+ isIEEE :: forall a. RealFloat a => a -> Bool
+ isInfinite :: forall a. RealFloat a => a -> Bool
+ isNaN :: forall a. RealFloat a => a -> Bool
+ isNegativeZero :: forall a. RealFloat a => a -> Bool
+ log :: forall a. Floating a => a -> a
+ logBase :: forall a. Floating a => a -> a -> a
+ pi :: forall a. Floating a => a
+ scaleFloat :: forall a. RealFloat a => Int -> a -> a
+ significand :: forall a. RealFloat a => a -> a
+ sin :: forall a. Floating a => a -> a
+ sinh :: forall a. Floating a => a -> a
+ sqrt :: forall a. Floating a => a -> a
+ tan :: forall a. Floating a => a -> a
+ tanh :: forall a. Floating a => a -> a
ioError :: forall a.
GHC.Internal.Stack.Types.HasCallStack =>
IOError -> IO a
@@ -105,6 +125,7 @@ holes3.hs:11:15: error: [GHC-88464]
[a] -> [a]
drop :: forall a. Int -> [a] -> [a]
dropWhile :: forall a. (a -> Bool) -> [a] -> [a]
+ filter :: forall a. (a -> Bool) -> [a] -> [a]
head :: forall a. GHC.Internal.Stack.Types.HasCallStack => [a] -> a
init :: forall a.
GHC.Internal.Stack.Types.HasCallStack =>
@@ -123,80 +144,57 @@ holes3.hs:11:15: error: [GHC-88464]
[a] -> [a]
take :: forall a. Int -> [a] -> [a]
takeWhile :: forall a. (a -> Bool) -> [a] -> [a]
- subtract :: forall a. Num a => a -> a -> a
- readParen :: forall a. Bool -> ReadS a -> ReadS a
- (^) :: forall a b. (Num a, Integral b) => a -> b -> a
- even :: forall a. Integral a => a -> Bool
- gcd :: forall a. Integral a => a -> a -> a
- lcm :: forall a. Integral a => a -> a -> a
- odd :: forall a. Integral a => a -> Bool
- (**) :: forall a. Floating a => a -> a -> a
- acos :: forall a. Floating a => a -> a
- acosh :: forall a. Floating a => a -> a
- asin :: forall a. Floating a => a -> a
- asinh :: forall a. Floating a => a -> a
- atan :: forall a. Floating a => a -> a
- atanh :: forall a. Floating a => a -> a
- cos :: forall a. Floating a => a -> a
- cosh :: forall a. Floating a => a -> a
- exp :: forall a. Floating a => a -> a
- log :: forall a. Floating a => a -> a
- logBase :: forall a. Floating a => a -> a -> a
- pi :: forall a. Floating a => a
- sin :: forall a. Floating a => a -> a
- sinh :: forall a. Floating a => a -> a
- sqrt :: forall a. Floating a => a -> a
- tan :: forall a. Floating a => a -> a
- tanh :: forall a. Floating a => a -> a
- atan2 :: forall a. RealFloat a => a -> a -> a
- decodeFloat :: forall a. RealFloat a => a -> (Integer, Int)
- encodeFloat :: forall a. RealFloat a => Integer -> Int -> a
- exponent :: forall a. RealFloat a => a -> Int
- floatDigits :: forall a. RealFloat a => a -> Int
- floatRadix :: forall a. RealFloat a => a -> Integer
- floatRange :: forall a. RealFloat a => a -> (Int, Int)
- isDenormalized :: forall a. RealFloat a => a -> Bool
- isIEEE :: forall a. RealFloat a => a -> Bool
- isInfinite :: forall a. RealFloat a => a -> Bool
- isNaN :: forall a. RealFloat a => a -> Bool
- isNegativeZero :: forall a. RealFloat a => a -> Bool
- scaleFloat :: forall a. RealFloat a => Int -> a -> a
- significand :: forall a. RealFloat a => a -> a
(*) :: forall a. Num a => a -> a -> a
(+) :: forall a. Num a => a -> a -> a
+ (-) :: forall a. Num a => a -> a -> a
abs :: forall a. Num a => a -> a
+ fromInteger :: forall a. Num a => Integer -> a
+ negate :: forall a. Num a => a -> a
signum :: forall a. Num a => a -> a
+ subtract :: forall a. Num a => a -> a -> a
+ readParen :: forall a. Bool -> ReadS a -> ReadS a
(/) :: forall a. Fractional a => a -> a -> a
- recip :: forall a. Fractional a => a -> a
+ (^) :: forall a b. (Num a, Integral b) => a -> b -> a
div :: forall a. Integral a => a -> a -> a
divMod :: forall a. Integral a => a -> a -> (a, a)
+ even :: forall a. Integral a => a -> Bool
+ fromIntegral :: forall a b. (Integral a, Num b) => a -> b
+ fromRational :: forall a. Fractional a => Rational -> a
+ gcd :: forall a. Integral a => a -> a -> a
+ lcm :: forall a. Integral a => a -> a -> a
mod :: forall a. Integral a => a -> a -> a
+ odd :: forall a. Integral a => a -> Bool
quot :: forall a. Integral a => a -> a -> a
quotRem :: forall a. Integral a => a -> a -> (a, a)
+ recip :: forall a. Fractional a => a -> a
rem :: forall a. Integral a => a -> a -> a
- zip :: forall a b. [a] -> [b] -> [(a, b)]
+ toInteger :: forall a. Integral a => a -> Integer
+ toRational :: forall a. Real a => a -> Rational
+ Just :: forall a. a -> Maybe a
+ Nothing :: forall a. Maybe a
+ (:) :: forall a. a -> [a] -> [a]
+ [] :: forall a. [a]
+ const :: forall a b. a -> b -> a
map :: forall a b. (a -> b) -> [a] -> [b]
- realToFrac :: forall a b. (Real a, Fractional b) => a -> b
Left :: forall a b. a -> Either a b
Right :: forall a b. b -> Either a b
- (,) :: forall a b. a -> b -> (a, b)
- const :: forall a b. a -> b -> a
maybe :: forall b a. b -> (a -> b) -> Maybe a -> b
fst :: forall a b. (a, b) -> a
snd :: forall a b. (a, b) -> b
scanl :: forall b a. (b -> a -> b) -> b -> [a] -> [b]
scanr :: forall a b. (a -> b -> b) -> b -> [a] -> [b]
unzip :: forall a b. [(a, b)] -> ([a], [b])
+ zip :: forall a b. [a] -> [b] -> [(a, b)]
(^^) :: forall a b. (Fractional a, Integral b) => a -> b -> a
ceiling :: forall a b. (RealFrac a, Integral b) => a -> b
floor :: forall a b. (RealFrac a, Integral b) => a -> b
properFraction :: forall a b.
(RealFrac a, Integral b) =>
a -> (b, a)
+ realToFrac :: forall a b. (Real a, Fractional b) => a -> b
round :: forall a b. (RealFrac a, Integral b) => a -> b
truncate :: forall a b. (RealFrac a, Integral b) => a -> b
- seq :: forall a b. a -> b -> b
- (,,) :: forall a b c. a -> b -> c -> (a, b, c)
+ (,) :: forall a b. a -> b -> (a, b)
($!) :: forall a b. (a -> b) -> a -> b
(.) :: forall b c a. (b -> c) -> (a -> b) -> a -> c
either :: forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
@@ -205,11 +203,13 @@ holes3.hs:11:15: error: [GHC-88464]
unzip3 :: forall a b c. [(a, b, c)] -> ([a], [b], [c])
zip3 :: forall a b c. [a] -> [b] -> [c] -> [(a, b, c)]
zipWith :: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
+ seq :: forall a b. a -> b -> b
+ (,,) :: forall a b c. a -> b -> c -> (a, b, c)
($) :: forall a b. (a -> b) -> a -> b
- (,,,) :: forall a b c d. a -> b -> c -> d -> (a, b, c, d)
flip :: forall a b c. (a -> b -> c) -> b -> a -> c
zipWith3 :: forall a b c d.
(a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ (,,,) :: forall a b c d. a -> b -> c -> d -> (a, b, c, d)
(,,,,) :: forall a b c d e.
a -> b -> c -> d -> e -> (a, b, c, d, e)
(,,,,,) :: forall a b c d e f.
=====================================
testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr
=====================================
@@ -4,8 +4,8 @@ refinement_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
• Relevant bindings include
f :: [Integer] -> Integer (bound at refinement_hole_fits.hs:4:1)
Valid hole fits include
- f :: [Integer] -> Integer (bound at refinement_hole_fits.hs:4:1)
g :: [Integer] -> Integer (bound at refinement_hole_fits.hs:7:1)
+ f :: [Integer] -> Integer (bound at refinement_hole_fits.hs:4:1)
head :: forall a. GHC.Internal.Stack.Types.HasCallStack => [a] -> a
with head @Integer
(imported from ‘Prelude’
@@ -15,19 +15,19 @@ refinement_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.List’))
maximum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
- with maximum @[] @Integer
+ with maximum @[]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Data.Foldable’))
minimum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
- with minimum @[] @Integer
+ with minimum @[]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Data.Foldable’))
product :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
- with product @[] @Integer
+ with product @[]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Data.Foldable’))
sum :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
- with sum @[] @Integer
+ with sum @[]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Data.Foldable’))
Valid refinement hole fits include
@@ -35,35 +35,35 @@ refinement_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
where foldl1 :: forall (t :: * -> *) a.
Foldable t =>
(a -> a -> a) -> t a -> a
- with foldl1 @[] @Integer
+ with foldl1 @[]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Data.Foldable’))
foldr1 (_ :: Integer -> Integer -> Integer)
where foldr1 :: forall (t :: * -> *) a.
Foldable t =>
(a -> a -> a) -> t a -> a
- with foldr1 @[] @Integer
+ with foldr1 @[]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Data.Foldable’))
foldl (_ :: Integer -> Integer -> Integer) (_ :: Integer)
where foldl :: forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
- with foldl @[] @Integer @Integer
+ with foldl @[]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Data.Foldable’))
foldl' (_ :: Integer -> Integer -> Integer) (_ :: Integer)
where foldl' :: forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
- with foldl' @[] @Integer @Integer
+ with foldl' @[]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Data.Foldable’))
foldr (_ :: Integer -> Integer -> Integer) (_ :: Integer)
where foldr :: forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
- with foldr @[] @Integer @Integer
+ with foldr @[]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Data.Foldable’))
const (_ :: Integer)
@@ -84,14 +84,14 @@ refinement_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with ($!) @GHC.Internal.Types.LiftedRep @[Integer] @Integer
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- return (_ :: Integer)
- where return :: forall (m :: * -> *) a. Monad m => a -> m a
- with return @((->) [Integer]) @Integer
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Base’))
pure (_ :: Integer)
where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
- with pure @((->) [Integer]) @Integer
+ with pure @((->) [Integer])
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Base’))
+ return (_ :: Integer)
+ where return :: forall (m :: * -> *) a. Monad m => a -> m a
+ with return @((->) [Integer])
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
j (_ :: [Integer] -> Integer)
@@ -141,12 +141,12 @@ refinement_hole_fits.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with const @Integer @[Integer]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- return :: forall (m :: * -> *) a. Monad m => a -> m a
- with return @((->) [Integer]) @Integer
+ pure :: forall (f :: * -> *) a. Applicative f => a -> f a
+ with pure @((->) [Integer])
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- pure :: forall (f :: * -> *) a. Applicative f => a -> f a
- with pure @((->) [Integer]) @Integer
+ return :: forall (m :: * -> *) a. Monad m => a -> m a
+ with return @((->) [Integer])
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
Valid refinement hole fits include
@@ -154,21 +154,21 @@ refinement_hole_fits.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
where foldl :: forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
- with foldl @[] @Integer @Integer
+ with foldl @[]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Data.Foldable’))
foldl' (_ :: Integer -> Integer -> Integer)
where foldl' :: forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
- with foldl' @[] @Integer @Integer
+ with foldl' @[]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Data.Foldable’))
foldr (_ :: Integer -> Integer -> Integer)
where foldr :: forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
- with foldr @[] @Integer @Integer
+ with foldr @[]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Data.Foldable’))
curry (_ :: (Integer, [Integer]) -> Integer)
@@ -204,14 +204,14 @@ refinement_hole_fits.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
@([Integer] -> Integer)
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
- return (_ :: [Integer] -> Integer)
- where return :: forall (m :: * -> *) a. Monad m => a -> m a
- with return @((->) Integer) @([Integer] -> Integer)
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Base’))
pure (_ :: [Integer] -> Integer)
where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
- with pure @((->) Integer) @([Integer] -> Integer)
+ with pure @((->) Integer)
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Base’))
+ return (_ :: [Integer] -> Integer)
+ where return :: forall (m :: * -> *) a. Monad m => a -> m a
+ with return @((->) Integer)
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
j (_ :: Integer -> [Integer] -> Integer)
=====================================
testsuite/tests/typecheck/should_compile/subsumption_sort_hole_fits.stderr
=====================================
@@ -26,15 +26,15 @@ subsumption_sort_hole_fits.hs:2:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdef
fail :: forall (m :: * -> *) a.
(MonadFail m, GHC.Internal.Stack.Types.HasCallStack) =>
String -> m a
- with fail @[] @String
+ with fail @[]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Control.Monad.Fail’))
return :: forall (m :: * -> *) a. Monad m => a -> m a
- with return @[] @String
+ with return @[]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
pure :: forall (f :: * -> *) a. Applicative f => a -> f a
- with pure @[] @String
+ with pure @[]
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Base’))
=====================================
testsuite/tests/typecheck/should_compile/type_in_type_hole_fits.stderr
=====================================
@@ -1,4 +1,3 @@
-
type_in_type_hole_fits.hs:79:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
• Found hole:
_a :: [Integer] -> Sorted (O (NLogN 2 0)) (O N) True Integer
@@ -14,18 +13,18 @@ type_in_type_hole_fits.hs:79:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefau
[a] -> Sorted cpu mem stable a
with Sorted @(O (NLogN 2 0)) @(O N) @True @Integer
(defined at type_in_type_hole_fits.hs:54:18)
- mergeSort :: forall a (n :: AsympPoly) (m :: AsympPoly)
- (s :: Bool).
- (Ord a, n >=. O (N *. LogN), m >=. O N, IsStable s) =>
- [a] -> Sorted n m s a
- with mergeSort @Integer @(O (NLogN 2 0)) @(O N) @True
- (defined at type_in_type_hole_fits.hs:61:1)
insertionSort :: forall a (n :: AsympPoly) (m :: AsympPoly)
(s :: Bool).
(Ord a, n >=. O (N ^. 2), m >=. O One, IsStable s) =>
[a] -> Sorted n m s a
with insertionSort @Integer @(O (NLogN 2 0)) @(O N) @True
(defined at type_in_type_hole_fits.hs:65:1)
+ mergeSort :: forall a (n :: AsympPoly) (m :: AsympPoly)
+ (s :: Bool).
+ (Ord a, n >=. O (N *. LogN), m >=. O N, IsStable s) =>
+ [a] -> Sorted n m s a
+ with mergeSort @Integer @(O (NLogN 2 0)) @(O N) @True
+ (defined at type_in_type_hole_fits.hs:61:1)
type_in_type_hole_fits.hs:82:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
• Found hole:
@@ -37,16 +36,16 @@ type_in_type_hole_fits.hs:82:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefau
mySortB :: Sorted (O (N *. LogN)) (O N) False Integer
(bound at type_in_type_hole_fits.hs:82:1)
Valid hole fits include
- quickSort :: forall a (n :: AsympPoly) (m :: AsympPoly).
- (Ord a, n >=. O (N *. LogN), m >=. O N) =>
- [a] -> Sorted n m False a
- with quickSort @Integer @(O (NLogN 1 1)) @(O N)
- (defined at type_in_type_hole_fits.hs:71:1)
heapSort :: forall a (n :: AsympPoly) (m :: AsympPoly).
(Ord a, n >=. O (N *. LogN), m >=. O One) =>
[a] -> Sorted n m False a
with heapSort @Integer @(O (NLogN 1 1)) @(O N)
(defined at type_in_type_hole_fits.hs:74:1)
+ quickSort :: forall a (n :: AsympPoly) (m :: AsympPoly).
+ (Ord a, n >=. O (N *. LogN), m >=. O N) =>
+ [a] -> Sorted n m False a
+ with quickSort @Integer @(O (NLogN 1 1)) @(O N)
+ (defined at type_in_type_hole_fits.hs:71:1)
Sorted :: forall (cpu :: AsympPoly) (mem :: AsympPoly)
(stable :: Bool) a.
[a] -> Sorted cpu mem stable a
@@ -79,3 +78,4 @@ type_in_type_hole_fits.hs:85:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefau
[a] -> Sorted cpu mem stable a
with Sorted @(O (NLogN 1 1)) @(O One) @False @Integer
(defined at type_in_type_hole_fits.hs:54:18)
+
=====================================
testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr
=====================================
@@ -25,15 +25,15 @@ valid_hole_fits.hs:17:17: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
x :: Int (bound at valid_hole_fits.hs:16:12)
c :: Int -> IO Int (bound at valid_hole_fits.hs:16:1)
Valid hole fits include
- c :: Int -> IO Int (bound at valid_hole_fits.hs:16:1)
a :: Int -> IO Int (bound at valid_hole_fits.hs:12:1)
b :: Int -> IO Int (bound at valid_hole_fits.hs:14:1)
- return :: forall (m :: * -> *) a. Monad m => a -> m a
- with return @IO @Int
+ c :: Int -> IO Int (bound at valid_hole_fits.hs:16:1)
+ pure :: forall (f :: * -> *) a. Applicative f => a -> f a
+ with pure @IO
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.Base’))
- pure :: forall (f :: * -> *) a. Applicative f => a -> f a
- with pure @IO @Int
+ return :: forall (m :: * -> *) a. Monad m => a -> m a
+ with return @IO
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.Base’))
@@ -82,12 +82,12 @@ valid_hole_fits.hs:27:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with Just @Integer
(imported from ‘Data.Maybe’ at valid_hole_fits.hs:5:1-17
(and originally defined in ‘GHC.Internal.Maybe’))
- return :: forall (m :: * -> *) a. Monad m => a -> m a
- with return @Maybe @Integer
+ pure :: forall (f :: * -> *) a. Applicative f => a -> f a
+ with pure @Maybe
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.Base’))
- pure :: forall (f :: * -> *) a. Applicative f => a -> f a
- with pure @Maybe @Integer
+ return :: forall (m :: * -> *) a. Monad m => a -> m a
+ with return @Maybe
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.Base’))
@@ -100,28 +100,28 @@ valid_hole_fits.hs:30:10: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
• Relevant bindings include
f :: String (bound at valid_hole_fits.hs:30:1)
Valid hole fits include
- f :: String (bound at valid_hole_fits.hs:30:1)
- k :: Maybe Integer (defined at valid_hole_fits.hs:27:1)
h :: String (bound at valid_hole_fits.hs:34:1)
+ k :: Maybe Integer (defined at valid_hole_fits.hs:27:1)
+ f :: String (bound at valid_hole_fits.hs:30:1)
otherwise :: Bool
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.Base’))
- False :: Bool
+ EQ :: Ordering
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.Types’))
- True :: Bool
+ GT :: Ordering
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.Types’))
LT :: Ordering
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.Types’))
- EQ :: Ordering
+ () :: () (bound at <wired into compiler>)
+ False :: Bool
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.Types’))
- GT :: Ordering
+ True :: Bool
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.Types’))
- () :: () (bound at <wired into compiler>)
pi :: forall a. Floating a => a
with pi @Double
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
@@ -139,22 +139,14 @@ valid_hole_fits.hs:34:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
not :: Bool -> Bool
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.Classes’))
- enumFrom :: forall a. Enum a => a -> [a]
- with enumFrom @Bool
- (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
- (and originally defined in ‘GHC.Internal.Enum’))
- Just :: forall a. a -> Maybe a
- with Just @Bool
- (imported from ‘Data.Maybe’ at valid_hole_fits.hs:5:1-17
- (and originally defined in ‘GHC.Internal.Maybe’))
id :: forall a. a -> a
with id @Bool
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.Base’))
- repeat :: forall a. a -> [a]
- with repeat @Bool
+ enumFrom :: forall a. Enum a => a -> [a]
+ with enumFrom @Bool
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
- (and originally defined in ‘GHC.Internal.List’))
+ (and originally defined in ‘GHC.Internal.Enum’))
fromEnum :: forall a. Enum a => a -> Int
with fromEnum @Bool
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
@@ -167,10 +159,18 @@ valid_hole_fits.hs:34:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with succ @Bool
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.Enum’))
+ repeat :: forall a. a -> [a]
+ with repeat @Bool
+ (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
+ (and originally defined in ‘GHC.Internal.List’))
show :: forall a. Show a => a -> String
with show @Bool
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.Show’))
+ Just :: forall a. a -> Maybe a
+ with Just @Bool
+ (imported from ‘Data.Maybe’ at valid_hole_fits.hs:5:1-17
+ (and originally defined in ‘GHC.Internal.Maybe’))
valid_hole_fits.hs:34:14: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: Bool
@@ -213,7 +213,7 @@ valid_hole_fits.hs:38:10: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with (:) @a
(bound at <wired into compiler>)
(<$) :: forall (f :: * -> *) a b. Functor f => a -> f b -> f a
- with (<$) @[] @a @a
+ with (<$) @[]
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.Base’))
seq :: forall a b. a -> b -> b
@@ -243,16 +243,16 @@ valid_hole_fits.hs:41:8: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
with readIO @()
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.System.IO’))
- print :: forall a. Show a => a -> IO ()
- with print @String
- (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
- (and originally defined in ‘GHC.Internal.System.IO’))
fail :: forall (m :: * -> *) a.
(MonadFail m, GHC.Internal.Stack.Types.HasCallStack) =>
String -> m a
- with fail @IO @()
+ with fail @IO
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
(and originally defined in ‘GHC.Internal.Control.Monad.Fail’))
+ print :: forall a. Show a => a -> IO ()
+ with print @String
+ (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
+ (and originally defined in ‘GHC.Internal.System.IO’))
mempty :: forall a. Monoid a => a
with mempty @(String -> IO ())
(imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
=====================================
testsuite/tests/typecheck/should_compile/valid_hole_fits_interactions.stderr
=====================================
@@ -1,10 +1,10 @@
-
valid_hole_fits_interactions.hs:15:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: SBool True
• In an equation for ‘f’: f = _
• Relevant bindings include
f :: SBool True (bound at valid_hole_fits_interactions.hs:15:1)
Valid hole fits include
- f :: SBool True (bound at valid_hole_fits_interactions.hs:15:1)
STrue :: SBool True
(defined at valid_hole_fits_interactions.hs:12:3)
+ f :: SBool True (bound at valid_hole_fits_interactions.hs:15:1)
+
=====================================
testsuite/tests/typecheck/should_fail/T14884.stderr
=====================================
@@ -5,18 +5,18 @@ T14884.hs:4:5: error: [GHC-88464]
In an equation for ‘x’: x = _ print "abc"
• Relevant bindings include x :: IO () (bound at T14884.hs:4:1)
Valid hole fits include
+ foldMap :: forall (t :: * -> *) m a.
+ (Foldable t, Monoid m) =>
+ (a -> m) -> t a -> m
+ with foldMap @[]
+ (imported from ‘Prelude’
+ (and originally defined in ‘GHC.Internal.Data.Foldable’))
mapM_ :: forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
with mapM_ @[] @IO @Char @()
(imported from ‘Prelude’
(and originally defined in ‘GHC.Internal.Data.Foldable’))
- foldMap :: forall (t :: * -> *) m a.
- (Foldable t, Monoid m) =>
- (a -> m) -> t a -> m
- with foldMap @[] @(IO ()) @Char
- (imported from ‘Prelude’
- (and originally defined in ‘GHC.Internal.Data.Foldable’))
id :: forall a. a -> a
with id @(String -> IO ())
(imported from ‘Prelude’
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/eb0628b1ed44c6f80a1c9fb409f115…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/eb0628b1ed44c6f80a1c9fb409f115…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/T26579] 56 commits: Fix syntax error in gadt_syntax.rst
by Peter Trommler (@trommler) 23 Dec '25
by Peter Trommler (@trommler) 23 Dec '25
23 Dec '25
Peter Trommler pushed to branch wip/T26579 at Glasgow Haskell Compiler / GHC
Commits:
d4b1e353 by Simon Hengel at 2025-12-10T00:00:02-05:00
Fix syntax error in gadt_syntax.rst
- - - - -
91cc8be6 by Cheng Shao at 2025-12-10T00:00:43-05:00
ci: fix "ci.sh clean" to address frequent out of space error on windows runners
This patch fixes the `ci.sh clean` logic to address frequent out of
space error on windows runners; previously it didn't clean up the
inplace mingw blobs, which is the largest source of space leak on
windows runners. See added comment for detailed explanation.
- - - - -
fe2b79f4 by Recursion Ninja at 2025-12-10T08:34:18-05:00
Narrow before optimising MUL/DIV/REM into shifts
The MUL/DIV/REM operations can be optimised into shifts when one of the
operands is a constant power of 2. However, as literals in Cmm are
stored as 'Integer', for this to be correct we first need to narrow the
literal to the appropriate width before checking whether the literal is
a power of 2.
Fixes #25664
- - - - -
06c2349c by Recursion Ninja at 2025-12-10T08:34:58-05:00
Decouple 'Language.Haskell.Syntax.Type' from 'GHC.Utils.Panic'
- Remove the *original* defintion of 'hsQTvExplicit' defined within 'Language.Haskell.Syntax.Type'
- Redefine 'hsQTvExplicit' as 'hsq_explicit' specialized to 'GhcPass' exported by 'GHC.Utils.Panic'
- Define 'hsQTvExplicitBinders' as 'hsq_explicit' specialized to 'DocNameI' exported by 'Haddock.GhcUtils'.
- Replace all call sites of the original 'hsQTvExplicit' definition with either:
1. 'hsQTvExplicit' updated definition
2. 'hsQTvExplicitBinders'
All call sites never entered the 'XLHsQTyVars' constructor branch, but a call to 'panic' existed on this code path because the type system was not strong enought to guarantee that the 'XLHsQTyVars' construction was impossible.
These two specialized functions provide the type system with enough information to make that guarantee, and hence the dependancy on 'panic' can be removed.
- - - - -
ac0815d5 by sheaf at 2025-12-10T23:39:57-05:00
Quantify arg before mult in function arrows
As noted in #23764, we expect quantification order to be left-to-right,
so that in a type such as
a %m -> b
the inferred quantification order should be [a, m, b] and not [m, a, b].
This was addressed in commit d31fbf6c, but that commit failed to update
some other functions such as GHC.Core.TyCo.FVs.tyCoFVsOfType.
This affects Haddock, as whether we print an explicit forall or not
depends on whether the inferred quantification order matches the actual
quantification order.
- - - - -
2caf796e by sheaf at 2025-12-10T23:39:57-05:00
Haddock: improvements to ty-var quantification
This commit makes several improvements to how Haddock deals with the
quantification of type variables:
1. In pattern synonyms, Haddock used to jumble up universal and
existential quantification. That is now fixed, fixing #26252.
Tested in the 'PatternSyns2' haddock-html test.
2. The logic for computing whether to use an explicit kind annotation
for a type variable quantified in a forall was not even wrong.
This commit improves the heuristic, but it will always remain an
imperfect heuristic (lest we actually run kind inference again).
In the future (#26271), we hope to avoid reliance on this heuristic.
- - - - -
b14bdd59 by Teo Camarasu at 2025-12-10T23:40:38-05:00
Add explicit export list to GHC.Num
Let's make clear what this module exports to allow us to easily deprecate and remove some of these in the future. Resolves https://gitlab.haskell.org/ghc/ghc/-/issues/26625
- - - - -
d99f8326 by Cheng Shao at 2025-12-11T19:14:18-05:00
compiler: remove unused CPP code in foreign stub
This patch removes unused CPP code in the generated foreign stub:
- `#define IN_STG_CODE 0` is not needed, since `Rts.h` already
includes this definition
- The `if defined(__cplusplus)` code paths are not needed in the `.c`
file, since we don't generate C++ stubs and don't include C++
headers in our stubs. But it still needs to be present in the `.h`
header since it might be later included into C++ source files.
- - - - -
46c9746f by Cheng Shao at 2025-12-11T19:14:57-05:00
configure: bump LlvmMaxVersion to 22
This commit bumps LlvmMaxVersion to 22; 21.x releases have been
available since Aug 26th, 2025 and there's no regressions with 21.x so
far. This bump is also required for updating fedora image to 43.
- - - - -
96fce8d0 by Cheng Shao at 2025-12-12T01:17:51+01:00
hadrian: add support for building with UndefinedBehaviorSanitizer
This patch adds a +ubsan flavour transformer to hadrian to build all
stage1+ C/C++ code with UndefinedBehaviorSanitizer. This is
particularly useful to catch potential undefined behavior in the RTS
codebase.
- - - - -
f7a06d8c by Cheng Shao at 2025-12-12T01:17:51+01:00
ci: update alpine/fedora & add ubsan job
This patch updates alpine image to 3.23, fedora image to 43, and adds
a `x86_64-linux-fedora43-validate+debug_info+ubsan` job that's run in
validate/nightly pipelines to catch undefined behavior in the RTS
codebase.
- - - - -
2ccd11ca by Cheng Shao at 2025-12-12T01:17:51+01:00
rts: fix zero-length VLA undefined behavior in interpretBCO
This commit fixes a zero-length VLA undefined behavior in interpretBCO, caught by UBSan:
```
+rts/Interpreter.c:3133:19: runtime variable length array bound evaluates to non-positive value 0
```
- - - - -
4156ed19 by Cheng Shao at 2025-12-12T01:17:51+01:00
rts: fix unaligned ReadSpB in interpretBCO
This commit fixes unaligned ReadSpB in interpretBCO, caught by UBSan:
```
+rts/Interpreter.c:2174:64: runtime load of misaligned address 0x004202059dd1 for type 'StgWord', which requires 8 byte alignment
```
To perform proper unaligned read, we define StgUnalignedWord as a type
alias of StgWord with aligned(1) attribute, and load StgUnalignedWord
instead of StgWord in ReadSpB, so the C compiler is aware that we're
not loading with natural alignment.
- - - - -
fef89fb9 by Cheng Shao at 2025-12-12T01:17:51+01:00
rts: fix signed integer overflow in subword arithmetic in interpretBCO
This commit fixes signed integer overflow in subword arithmetic in
interpretBCO, see added note for detailed explanation.
- - - - -
3c001377 by Cheng Shao at 2025-12-13T05:03:15-05:00
ci: use treeless fetch for perf notes
This patch improves the ci logic for fetching perf notes by using
treeless fetch
(https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-…)
to avoid downloading all blobs of the perf notes repo at once, and
only fetch the actually required blobs on-demand when needed. This
makes the initial `test-metrics.sh pull` operation much faster, and
also more robust, since we are seeing an increasing rate of 504 errors
in CI when fetching all perf notes at once, which is a major source of
CI flakiness at this point.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
123a8d77 by Peter Trommler at 2025-12-13T05:03:57-05:00
Cmm: remove restriction in MachOp folding
- - - - -
0b54b5fd by Andreas Klebinger at 2025-12-13T05:04:38-05:00
Remove explicit Typeable deriviations.
- - - - -
08b13f7b by Cheng Shao at 2025-12-13T05:05:18-05:00
ci: set gc.auto=0 during setup stage
This patch sets `gc.auto=0` during `setup` stage of CI, see added
comment for detailed explanation.
- - - - -
3b5aecb5 by Ben Gamari at 2025-12-13T23:43:10+01:00
Bump exceptions submodule to 0.10.11
- - - - -
c32de3b0 by Johan Förberg at 2025-12-15T02:36:03-05:00
base: Define Semigroup and Monoid instances for lazy ST
CLC proposal:
https://github.com/haskell/core-libraries-committee/issues/374
Fixes #26581
- - - - -
4f8b660c by mangoiv at 2025-12-15T02:37:05-05:00
ci: do not require nightly cabal-reinstall job to succeed
- - - - -
2c2a3ef3 by Cheng Shao at 2025-12-15T11:51:53-05:00
docs: drop obsolete warning about -fexternal-interpreter on windows
This patch drops an obsolete warning about -fexternal-interpreter not
supported on windows; it is supported since a long time ago, including
the profiled way.
- - - - -
68573aa5 by Marc Scholten at 2025-12-15T11:53:00-05:00
haddock: Drop Haddock.Backends.HaddockDB as it's unused
- - - - -
b230d549 by mangoiv at 2025-12-16T15:17:45-05:00
base: generalize delete{Firsts,}By
When we delete{Firsts,}By we should not require the
lists to be the same type. This is an especially useful
generalisation in the case of deleteFirstsBy because we
can skip an invocation of the map function.
This change was discussed on the core-libraries-committee's bug
tracker at https://github.com/haskell/core-libraries-committee/issues/372.
- - - - -
6a2b43e3 by Cheng Shao at 2025-12-16T15:18:30-05:00
compiler: clean up redundant LANGUAGE pragmas
This patch bumps `default-language` of `ghc`/`ghc-bin` from `GHC2021`
to `GHC2024` (which is supported in ghc 9.10, current boot ghc lower
version bound), and also cleans up redundant `LANGUAGE` pragmas (as
well as `default-extensions`/`other-extensions`) that are already
implied by `GHC2024`.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
fca9cd7c by sheaf at 2025-12-18T13:18:18-05:00
X86 CodeGen: fix assign_eax_sse_regs
We must set %al to the number of SSE2 registers that contain arguments
(in case we are dealing with a varargs function). The logic for counting
how many arguments reside in SSE2 registers was incorrect, as it used
'isFloatFormat', which incorrectly ignores vector registers.
We now instead do case analysis on the register class:
is_sse_reg r =
case targetClassOfReg platform r of
RcFloatOrVector -> True
RcInteger -> False
This change is necessary to prevent segfaults in T20030_test1j, because
subsequent commits change the format calculations, resulting in vector
formats more often.
- - - - -
53150617 by sheaf at 2025-12-18T13:18:19-05:00
X86 regUsageOfInstr: fix format for IMUL
When used with 8-bit operands, the IMUL instruction returns the result
in the lower 16 bits of %rax (also known as %ax). This is different
than for the other sizes, where an input at 16, 32 or 64 bits will
result in 16, 32 or 64 bits of output in both %rax and %rdx.
This doesn't affect the behaviour of the compiler, because we don't
allow partial writes at sub-word sizes. The rationale is explained
in Wrinkle [Don't allow scalar partial writes] in Note [Register formats in liveness analysis],
in GHC.CmmToAsm.Reg.Liveness.
- - - - -
c7a56dd1 by sheaf at 2025-12-18T13:18:19-05:00
Liveness analysis: consider register formats
This commit updates the register allocator to be a bit more careful in
situations in which a single register is used at multiple different
formats, e.g. when xmm1 is used both to store a Double# and a DoubleX2#.
This is done by introducing the 'Regs' newtype around 'UniqSet RegWithFormat',
for which the combining operations take the larger of the two formats
instead of overriding the format.
Operations on 'Regs' are defined in 'GHC.CmmToAsm.Reg.Regs'. There is
a modest compile-time cost for the additional overhead for tracking
register formats, which causes the metric increases of this commit.
The subtle aspects of the implementation are outlined in
Note [Register formats in liveness analysis] in GHC.CmmToAsm.Reg.Liveness.
Fixes #26411 #26611
-------------------------
Metric Increase:
T12707
T26425
T3294
-------------------------
- - - - -
c2e83339 by sheaf at 2025-12-18T13:18:19-05:00
Register allocator: reload at same format as spill
This commit ensures that if we spill a register onto the stack at a
given format, we then always reload the register at this same format.
This ensures we don't end up in a situation where we spill F64x2 but end
up only reloading the lower F64. This first reload would make us believe
the whole data is in a register, thus silently losing the upper 64 bits
of the spilled register's contents.
Fixes #26526
- - - - -
55ab583b by sheaf at 2025-12-18T13:18:19-05:00
Register allocation: writes redefine format
As explained in Note [Allocated register formats] in GHC.CmmToAsm.Reg.Linear,
we consider all writes to redefine the format of the register.
This ensures that in a situation such as
movsd .Ln6m(%rip),%v1
shufpd $0,%v1,%v1
we properly consider the broadcast operation to change the format of %v1
from F64 to F64x2.
This completes the fix to #26411 (test in T26411b).
- - - - -
951402ed by Vladislav Zavialov at 2025-12-18T13:19:05-05:00
Parser: improve mkModuleImpExp, remove checkImportSpec
1. The `mkModuleImpExp` helper now knows whether it is processing an import or
export list item, and uses this information to produce a more accurate error
message for `import M (T(..,x))` with PatternSynonyms disabled.
The old message incorrectly referred to this case as an export form.
2. The `checkImportSpec` helper is removed in favor of more comprehensive error
checking in `mkModuleImpExp`.
3. Additionaly, the invariants of `ImpExpList` and `ImpExpAllWith` have been
made more explicit in the comments and assertions (calls to 'panic').
Test case: import-syntax-no-ext
- - - - -
47d83d96 by Vladislav Zavialov at 2025-12-18T13:19:06-05:00
Subordinate namespace-specified wildcards (#25901)
Add support for subordinate namespace-specified wildcards
`X(type ..)` and `X(data ..)` to import and export lists.
Examples:
import M (Cls(type ..)) -- imports Cls and all its associated types
import M (Cls(data ..)) -- imports Cls and all its methods
module M (R(data ..), C(type ..)) where
-- exports R and all its data constructors and record fields;
-- exports C and all its associated types, but not its methods
The scope of this change is limited to the case where the wildcard is the only
subordinate import/export item, whereas the more complex forms `X(type .., f)`
or `X(type .., data ..)` are unsupported and raise the newly introduced
PsErrUnsupportedExplicitNamespace error. This restriction may be lifted later.
Summary of the changes:
1. Refactor IEThingAll to store its extension field XIEThingAll as a record
IEThingAllExt instead of a tuple.
2. Extend the AST by adding a NamespaceSpecifier field to IEThingAllExt,
representing an optional namespace specifier `type` or `data` in front
of a subordinate wildcard `X(..)`.
3. Extend the grammar in Parser.y with productions for `type ..` and `data ..`
in subordinate import/export items.
4. Introduce `filterByNamespaceGREs` to filter [GlobalRdrElt] by a
NamespaceSpecifier; use it in `filterImports` and `exports_from_avail`
to account for the namespace specifier in IEThingAll.
5. Improve diagnostics by storing more information in DodgyImportsEmptyParent
and DodgyExportsEmptyParent.
Test cases:
T25901_sub_e T25901_sub_f T25901_sub_g T25901_sub_a
T25901_sub_b T25901_sub_c T25901_sub_d T25901_sub_w
DodgyImports02 DodgyImports03 DodgyImports04
- - - - -
eac418bb by Recursion Ninja at 2025-12-18T13:19:48-05:00
Removing the 'Data' instance for 'InstEnv'.
The 'Data' instance is blocking work on Trees that Grow, and the
'Data' instance seem to have been added without a clear purpose.
- - - - -
e920e038 by Recursion Ninja at 2025-12-18T13:19:48-05:00
'Decouple Language.Haskell.Syntax.Decls' from 'GHC.Unit.Module.Warnings'
- - - - -
bd38b76c by Cheng Shao at 2025-12-18T13:20:31-05:00
testsuite: improve coverage of foundation test
This patch refactors the `foundation` test a bit to improve coverage:
- Instead of using a hard-coded seed, a random seed is now taken from
the command line, and printed upon test failure. This improves test
coverage over many future CI runs, and shall a failure occur, the
seed is available in the CI log for local reproduction.
- The iterations count is bumped to 1000 instead of 100, similar to
the bump in `test-primops`. Runtime timeout is bumped 2x just to be
safe.
- Improve `newLCGGen` by using non-atomic loads/stores on a
`MutableByteArray#` for storing mutable `Word64`, this test doesn't
use parallelism in the first place
- Fixed a few compiler warnings and removed redundant pragmas and
imports
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
3995187c by Sylvain Henry at 2025-12-18T13:21:45-05:00
Doc: document -pgmi "" (#26634)
- - - - -
5729418c by Cheng Shao at 2025-12-18T13:22:29-05:00
rts: use __builtin_mul_overflow for hs_mulIntMayOflo
This patch uses `__builtin_mul_overflow` to implement
`hs_mulIntMayOflo`. This is a GNU C checked arithmetic builtin
function supported by gcc/clang, is type-generic so works for both
32-bit/64-bit, and makes the code both more efficient and easier to
read/maintain than the previous hand rolled logic.
- - - - -
1ca4b49a by Cheng Shao at 2025-12-18T13:23:11-05:00
compiler/rts: fix ABI mismatch in barf() invocations
This patch fixes a long-standing issue of ABI mismatch in `barf()`
invocations, both in compiler-emitted code and in hand written Cmm
code:
- In RTS, we have `barf()` which reports a fatal internal error
message and exits the program.
- `barf()` is a variadic C function! When used as a callee of a
foreign call with `ccall` calling convention instead of `capi`,
there is an ABI mismatch between the caller and the callee!
- Unfortunately, both the compiler and the Cmm sources contain many
places where we call `barf()` via `ccall` convention!! Like, when
you write `foreign "C" barf("foo object (%p) entered!", R1)`, it
totally doesn't do what you think it'll do at all!! The second
argument `R1` is not properly passed in `va_list`, and the behavior
is completely undefined!!
- Even more unfortunately, this issue has been sitting around long
enough because the ABI mismatch is subtle enough on normie platforms
like x64 and arm64.
- But there are platforms like wasm32 that are stricter about ABI, and
the broken `barf()` invocations already causes trouble for wasm
backend: we had to use ugly hacks like `barf(errmsg, NULL)` to make
`wasm-ld` happy, and even with this band-aid, compiler-generated
`barf()` invocations are still broken, resulting in regressions in
certain debug-related functionality, e.g. `-dtag-inference-checks`
is broken on wasm32 (#22882).
This patch properly fixes the issue:
- We add non-variadic `barf` wrappers in the RTS that can be used as
`ccall` callees
- Both the compiler `emitBarf` logic and the hand-written Cmm are
changed to call these wrappers
- `emitBarf` now also properly annotates the foreign call as
`CmmNeverReturns` to indicate it's a noreturn call to enable more
efficient code generation
`-dtag-inference-checks` now works on wasm. Closes #22882.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
b3dd23b9 by Vilim Lendvaj at 2025-12-18T13:23:57-05:00
Remove outdated comment
The Traversable instance for ZipList is no longer in
GHC.Internal.Data.Traversable. In fact, it is right below this very comment.
- - - - -
9a9c2f03 by Cheng Shao at 2025-12-18T13:24:39-05:00
compiler: remove unused OtherSection logic
This patch removes the OtherSection logic in Cmm, given it's never
actually used by any of our backends.
- - - - -
91edd292 by Wolfgang Jeltsch at 2025-12-19T03:18:19-05:00
Remove unused known-key and name variables for generics
This removes the known-key and corresponding name variables for `K1`,
`M1`, `R`, `D`, `C`, `S`, and `URec` from `GHC.Generics`, as they are
apparently nowhere used in GHC’s source code.
- - - - -
73ee7e38 by Wolfgang Jeltsch at 2025-12-19T03:19:02-05:00
Remove unused known keys and names for generics classes
This removes the known-key and corresponding name variables for
`Datatype`, `Constructor`, and `Selector` from `GHC.Generics`, as they
are apparently nowhere used in GHC’s source code.
- - - - -
f69c5f14 by Cheng Shao at 2025-12-19T03:19:45-05:00
wasm: fix handling of ByteArray#/MutableByteArray# arguments in JSFFI imports
This patch fixes the handling of ByteArray#/MutableByteArray#
arguments in JSFFI imports, see the amended note and manual for
explanation. Also adds a test to witness the fix.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
224446a2 by Cheng Shao at 2025-12-20T07:49:54-05:00
rts: workaround -Werror=maybe-uninitialized false positives
In some cases gcc might report -Werror=maybe-uninitialized that we
know are false positives, but need to workaround it to make validate
builds with -Werror pass.
- - - - -
251ec087 by Cheng Shao at 2025-12-20T07:49:54-05:00
hadrian: use -Og as C/C++ optimization level when debugging
This commit enables -Og as optimization level when compiling the debug
ways of rts. According to gcc documentation
(https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-Og)
-Og is a better choice than -O0 for producing debuggable code. It's
also supported by clang as well, so it makes sense to use it as a
default for debugging. Also add missing -g3 flag to C++ compilation
flags in +debug_info flavour transformer.
- - - - -
fb586c67 by Cheng Shao at 2025-12-20T07:50:36-05:00
compiler: replace DList with OrdList
This patch removes `DList` logic from the compiler and replaces it
with `OrdList` which also supports O(1) concatenation and should be
more memory efficient than the church-encoded `DList`.
- - - - -
8149c987 by Cheng Shao at 2025-12-20T17:06:51-05:00
hadrian: add with_profiled_libs flavour transformer
This patch adds a `with_profiled_libs` flavour transformer to hadrian
which is the exact opposite of `no_profiled_libs`. It adds profiling
ways to stage1+ rts/library ways, and doesn't alter other flavour
settings. It is useful when needing to test profiling logic locally
with a quick flavour.
- - - - -
746b18cd by Cheng Shao at 2025-12-20T17:06:51-05:00
hadrian: fix missing profiled dynamic libraries in profiled_ghc
This commit fixes the profiled_ghc flavour transformer to include
profiled dynamic libraries as well, since they're supported by GHC
since !12595.
- - - - -
4dd7e3b9 by Cheng Shao at 2025-12-20T17:07:33-05:00
ci: set http.postBuffer to mitigate perf notes timeout on some runners
This patch sets http.postBuffer to mitigate the timeout when fetching
perf notes on some runners with slow internet connection. Fixes #26684.
- - - - -
bc36268a by Wolfgang Jeltsch at 2025-12-21T16:23:24-05:00
Remove unused known keys and names for type representations
This removes the known-key and corresponding name variables for
`TrName`, `TrNameD`, `TypeRep`, `KindRepTypeLitD`, `TypeLitSort`, and
`mkTrType`, as they are apparently nowhere used in GHC’s source code.
- - - - -
ff5050e9 by Wolfgang Jeltsch at 2025-12-21T16:24:04-05:00
Remove unused known keys and names for natural operations
This removes the known-key and corresponding name variables for
`naturalAndNot`, `naturalLog2`, `naturalLogBaseWord`, `naturalLogBase`,
`naturalPowMod`, `naturalSizeInBase`, `naturalToFloat`, and
`naturalToDouble`, as they are apparently nowhere used in GHC’s source
code.
- - - - -
424388c2 by Wolfgang Jeltsch at 2025-12-21T16:24:45-05:00
Remove the unused known key and name for `Fingerprint`
This removes the variables for the known key and the name of the
`Fingerprint` data constructor, as they are apparently nowhere used in
GHC’s source code.
- - - - -
a1ed86fe by Wolfgang Jeltsch at 2025-12-21T16:25:26-05:00
Remove the unused known key and name for `failIO`
This removes the variables for the known key and the name of the
`failIO` operation, as they are apparently nowhere used in GHC’s source
code.
- - - - -
b8220daf by Wolfgang Jeltsch at 2025-12-21T16:26:07-05:00
Remove the unused known key and name for `liftM`
This removes the variables for the known key and the name of the `liftM`
operation, as they are apparently nowhere used in GHC’s source code.
- - - - -
eb0628b1 by Wolfgang Jeltsch at 2025-12-21T16:26:47-05:00
Fix the documentation of `hIsClosed`
- - - - -
3d300c8f by Peter Trommler at 2025-12-22T22:19:15+01:00
Use half-word literals in info tables
With this commit info tables are mapped to the same assembler code
on big-endian and little-endian platforms.
Fixes #26579.
- - - - -
584 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- .gitlab/test-metrics.sh
- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Builtin/PrimOps/Ids.hs
- compiler/GHC/Builtin/Types/Literals.hs
- compiler/GHC/Builtin/Utils.hs
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Breakpoints.hs
- compiler/GHC/ByteCode/InfoTable.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/ByteCode/Linker.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Cmm.hs
- compiler/GHC/Cmm/BlockId.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/CommonBlockElim.hs
- compiler/GHC/Cmm/Config.hs
- compiler/GHC/Cmm/ContFlowOpt.hs
- compiler/GHC/Cmm/Dataflow.hs
- compiler/GHC/Cmm/Dataflow/Block.hs
- compiler/GHC/Cmm/Dataflow/Graph.hs
- compiler/GHC/Cmm/Dataflow/Label.hs
- compiler/GHC/Cmm/DebugBlock.hs
- compiler/GHC/Cmm/Dominators.hs
- compiler/GHC/Cmm/Expr.hs
- compiler/GHC/Cmm/Graph.hs
- compiler/GHC/Cmm/Info.hs
- compiler/GHC/Cmm/Info/Build.hs
- compiler/GHC/Cmm/LRegSet.hs
- compiler/GHC/Cmm/LayoutStack.hs
- compiler/GHC/Cmm/Lint.hs
- compiler/GHC/Cmm/Liveness.hs
- compiler/GHC/Cmm/MachOp.hs
- compiler/GHC/Cmm/Node.hs
- compiler/GHC/Cmm/Opt.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/ProcPoint.hs
- compiler/GHC/Cmm/Reducibility.hs
- compiler/GHC/Cmm/Reg.hs
- compiler/GHC/Cmm/Sink.hs
- compiler/GHC/Cmm/Switch.hs
- compiler/GHC/Cmm/Switch/Implement.hs
- compiler/GHC/Cmm/ThreadSanitizer.hs
- compiler/GHC/Cmm/UniqueRenamer.hs
- compiler/GHC/Cmm/Utils.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/BlockLayout.hs
- compiler/GHC/CmmToAsm/CFG.hs
- compiler/GHC/CmmToAsm/CPrim.hs
- compiler/GHC/CmmToAsm/Dwarf/Types.hs
- compiler/GHC/CmmToAsm/Format.hs
- compiler/GHC/CmmToAsm/LA64/CodeGen.hs
- compiler/GHC/CmmToAsm/LA64/Ppr.hs
- compiler/GHC/CmmToAsm/Monad.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/PPC/Ppr.hs
- compiler/GHC/CmmToAsm/Ppr.hs
- compiler/GHC/CmmToAsm/RV64/CodeGen.hs
- compiler/GHC/CmmToAsm/RV64/Ppr.hs
- compiler/GHC/CmmToAsm/Reg/Graph.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Coalesce.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs
- compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs
- compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs
- compiler/GHC/CmmToAsm/Reg/Linear.hs
- compiler/GHC/CmmToAsm/Reg/Linear/Base.hs
- compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs
- compiler/GHC/CmmToAsm/Reg/Linear/State.hs
- compiler/GHC/CmmToAsm/Reg/Linear/X86.hs
- compiler/GHC/CmmToAsm/Reg/Linear/X86_64.hs
- compiler/GHC/CmmToAsm/Reg/Liveness.hs
- + compiler/GHC/CmmToAsm/Reg/Regs.hs
- compiler/GHC/CmmToAsm/Reg/Target.hs
- compiler/GHC/CmmToAsm/Wasm.hs
- compiler/GHC/CmmToAsm/Wasm/Asm.hs
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- compiler/GHC/CmmToAsm/Wasm/Types.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/CmmToLlvm/Base.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/CmmToLlvm/Data.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Coercion.hs-boot
- compiler/GHC/Core/Coercion/Axiom.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/FamInstEnv.hs
- compiler/GHC/Core/InstEnv.hs
- compiler/GHC/Core/LateCC/OverloadedCalls.hs
- compiler/GHC/Core/LateCC/TopLevelBinds.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Lint/Interactive.hs
- compiler/GHC/Core/Map/Expr.hs
- compiler/GHC/Core/Map/Type.hs
- compiler/GHC/Core/Opt/CallerCC.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Core/Opt/Monad.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Ppr.hs
- compiler/GHC/Core/Predicate.hs
- compiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/Core/TyCo/Compare.hs
- compiler/GHC/Core/TyCo/FVs.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/TyCon/Env.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Type.hs-boot
- compiler/GHC/Core/Unify.hs
- compiler/GHC/CoreToStg.hs
- compiler/GHC/Data/Bag.hs
- compiler/GHC/Data/FastString.hs
- compiler/GHC/Data/Graph/Collapse.hs
- compiler/GHC/Data/Graph/Color.hs
- compiler/GHC/Data/Graph/Directed.hs
- compiler/GHC/Data/List/Infinite.hs
- compiler/GHC/Data/List/NonEmpty.hs
- compiler/GHC/Data/Maybe.hs
- compiler/GHC/Data/Pair.hs
- compiler/GHC/Data/Stream.hs
- compiler/GHC/Data/Strict.hs
- compiler/GHC/Data/StringBuffer.hs
- compiler/GHC/Data/TrieMap.hs
- compiler/GHC/Data/Word64Map.hs
- compiler/GHC/Driver/Backend.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/CmdLine.hs
- compiler/GHC/Driver/CodeOutput.hs
- compiler/GHC/Driver/Config/StgToCmm.hs
- compiler/GHC/Driver/Config/Tidy.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Env/KnotVars.hs
- compiler/GHC/Driver/Errors.hs
- compiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/Driver/Errors/Types.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/GenerateCgIPEStub.hs
- compiler/GHC/Driver/Hooks.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/MakeSem.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Pipeline/LogQueue.hs
- compiler/GHC/Driver/Pipeline/Monad.hs
- compiler/GHC/Driver/Pipeline/Phases.hs
- compiler/GHC/Driver/Plugins.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Driver/Session/Inspect.hs
- compiler/GHC/Driver/Session/Units.hs
- compiler/GHC/Hs.hs
- compiler/GHC/Hs/Basic.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Doc.hs
- compiler/GHC/Hs/Doc.hs-boot
- compiler/GHC/Hs/DocString.hs
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Expr.hs-boot
- compiler/GHC/Hs/Extension.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Lit.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Pat.hs-boot
- compiler/GHC/Hs/Stats.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Foreign/Decl.hs
- compiler/GHC/HsToCore/Foreign/Wasm.hs
- compiler/GHC/HsToCore/ListComp.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Match/Literal.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Pmc/Check.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Pmc/Solver.hs
- compiler/GHC/HsToCore/Pmc/Solver/Types.hs
- compiler/GHC/HsToCore/Pmc/Types.hs
- compiler/GHC/HsToCore/Pmc/Utils.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Utils.hs
- compiler/GHC/Iface/Binary.hs
- compiler/GHC/Iface/Decl.hs
- compiler/GHC/Iface/Env.hs
- compiler/GHC/Iface/Errors.hs
- compiler/GHC/Iface/Errors/Ppr.hs
- compiler/GHC/Iface/Errors/Types.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Ext/Debug.hs
- compiler/GHC/Iface/Ext/Types.hs
- compiler/GHC/Iface/Ext/Utils.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Iface/Rename.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/Iface/Type.hs
- compiler/GHC/Iface/Warnings.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/JS/Ident.hs
- compiler/GHC/JS/JStg/Monad.hs
- compiler/GHC/JS/JStg/Syntax.hs
- compiler/GHC/JS/Make.hs
- compiler/GHC/JS/Optimizer.hs
- compiler/GHC/JS/Ppr.hs
- compiler/GHC/JS/Syntax.hs
- compiler/GHC/JS/Transform.hs
- compiler/GHC/Linker/Deps.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Linker/Types.hs
- compiler/GHC/Llvm/MetaData.hs
- compiler/GHC/Llvm/Ppr.hs
- compiler/GHC/Llvm/Types.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/Errors/Basic.hs
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Parser/String.hs
- compiler/GHC/Parser/Types.hs
- compiler/GHC/Platform.hs
- compiler/GHC/Platform/Reg/Class.hs
- compiler/GHC/Platform/Reg/Class/NoVectors.hs
- compiler/GHC/Platform/Reg/Class/Separate.hs
- compiler/GHC/Platform/Reg/Class/Unified.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Expr.hs-boot
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Rename/Unbound.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Runtime/Heap/Layout.hs
- compiler/GHC/Runtime/Interpreter.hs
- compiler/GHC/Runtime/Interpreter/JS.hs
- compiler/GHC/Runtime/Interpreter/Process.hs
- compiler/GHC/Runtime/Interpreter/Types.hs
- compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs
- compiler/GHC/Settings/IO.hs
- compiler/GHC/Stg/Debug.hs
- compiler/GHC/Stg/EnforceEpt.hs
- compiler/GHC/Stg/EnforceEpt/Rewrite.hs
- compiler/GHC/Stg/EnforceEpt/TagSig.hs
- compiler/GHC/Stg/EnforceEpt/Types.hs
- compiler/GHC/Stg/FVs.hs
- compiler/GHC/Stg/Lift/Analysis.hs
- compiler/GHC/Stg/Lift/Monad.hs
- compiler/GHC/Stg/Lift/Types.hs
- compiler/GHC/Stg/Lint.hs
- compiler/GHC/Stg/Pipeline.hs
- compiler/GHC/Stg/Syntax.hs
- compiler/GHC/Stg/Unarise.hs
- compiler/GHC/Stg/Utils.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToCmm.hs
- compiler/GHC/StgToCmm/ArgRep.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/CgUtils.hs
- compiler/GHC/StgToCmm/Closure.hs
- compiler/GHC/StgToCmm/ExtCode.hs
- compiler/GHC/StgToCmm/InfoTableProv.hs
- compiler/GHC/StgToCmm/Lit.hs
- compiler/GHC/StgToCmm/Monad.hs
- compiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/StgToCmm/Utils.hs
- compiler/GHC/StgToJS/Apply.hs
- compiler/GHC/StgToJS/Arg.hs
- compiler/GHC/StgToJS/CodeGen.hs
- compiler/GHC/StgToJS/DataCon.hs
- compiler/GHC/StgToJS/Deps.hs
- compiler/GHC/StgToJS/Expr.hs
- compiler/GHC/StgToJS/ExprCtx.hs
- compiler/GHC/StgToJS/FFI.hs
- compiler/GHC/StgToJS/Heap.hs
- compiler/GHC/StgToJS/Linker/Linker.hs
- compiler/GHC/StgToJS/Linker/Opt.hs
- compiler/GHC/StgToJS/Linker/Types.hs
- compiler/GHC/StgToJS/Literal.hs
- compiler/GHC/StgToJS/Monad.hs
- compiler/GHC/StgToJS/Object.hs
- compiler/GHC/StgToJS/Rts/Rts.hs
- compiler/GHC/StgToJS/Rts/Types.hs
- compiler/GHC/StgToJS/Sinker/Collect.hs
- compiler/GHC/StgToJS/Sinker/Sinker.hs
- compiler/GHC/StgToJS/Sinker/StringsUnfloat.hs
- compiler/GHC/StgToJS/Types.hs
- compiler/GHC/StgToJS/Utils.hs
- compiler/GHC/SysTools.hs
- compiler/GHC/SysTools/Ar.hs
- compiler/GHC/SysTools/BaseDir.hs
- compiler/GHC/SysTools/Cpp.hs
- compiler/GHC/SysTools/Tasks.hs
- compiler/GHC/SysTools/Terminal.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Deriv/Functor.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Deriv/Generics.hs
- compiler/GHC/Tc/Deriv/Utils.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Hole.hs
- compiler/GHC/Tc/Errors/Hole/FitTypes.hs
- compiler/GHC/Tc/Errors/Hole/Plugin.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Errors/Types/PromotionErr.hs
- compiler/GHC/Tc/Gen/Annotation.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Arrow.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Default.hs
- compiler/GHC/Tc/Gen/Do.hs
- compiler/GHC/Tc/Gen/Export.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Foreign.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Instance/Family.hs
- compiler/GHC/Tc/Instance/FunDeps.hs
- compiler/GHC/Tc/Instance/Typeable.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Irred.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Types.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/TyCl/Utils.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/ErrCtxt.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Backpack.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/Instantiate.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Tc/Validity.hs
- compiler/GHC/Tc/Zonk/Monad.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Annotations.hs
- compiler/GHC/Types/Avail.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/CompleteMatch.hs
- compiler/GHC/Types/CostCentre.hs
- compiler/GHC/Types/CostCentre/State.hs
- compiler/GHC/Types/DefaultEnv.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Error.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/FieldLabel.hs
- compiler/GHC/Types/Fixity.hs
- compiler/GHC/Types/ForeignCall.hs
- compiler/GHC/Types/ForeignStubs.hs
- compiler/GHC/Types/GREInfo.hs
- compiler/GHC/Types/Hint.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/GHC/Types/Id/Info.hs
- compiler/GHC/Types/Id/Make.hs
- compiler/GHC/Types/Literal.hs
- compiler/GHC/Types/Name.hs
- compiler/GHC/Types/Name/Cache.hs
- compiler/GHC/Types/Name/Occurrence.hs
- compiler/GHC/Types/Name/Reader.hs
- compiler/GHC/Types/Name/Set.hs
- compiler/GHC/Types/PkgQual.hs
- compiler/GHC/Types/RepType.hs
- compiler/GHC/Types/SaneDouble.hs
- compiler/GHC/Types/SourceText.hs
- compiler/GHC/Types/SrcLoc.hs
- compiler/GHC/Types/Tickish.hs
- compiler/GHC/Types/TyThing.hs
- compiler/GHC/Types/Unique/DFM.hs
- compiler/GHC/Types/Unique/DSet.hs
- compiler/GHC/Types/Unique/FM.hs
- compiler/GHC/Types/Unique/Map.hs
- compiler/GHC/Types/Unique/SDFM.hs
- compiler/GHC/Types/Unique/Set.hs
- compiler/GHC/Types/Var.hs
- compiler/GHC/Unit.hs
- compiler/GHC/Unit/Env.hs
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Unit/Home/PackageTable.hs
- compiler/GHC/Unit/Info.hs
- compiler/GHC/Unit/Module.hs
- compiler/GHC/Unit/Module/Deps.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Unit/Module/ModIface.hs
- compiler/GHC/Unit/Module/ModSummary.hs
- compiler/GHC/Unit/Module/Status.hs
- compiler/GHC/Unit/Module/Warnings.hs
- compiler/GHC/Unit/Module/WholeCoreBindings.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Unit/Types.hs-boot
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Binary/Typeable.hs
- compiler/GHC/Utils/Exception.hs
- compiler/GHC/Utils/Json.hs
- compiler/GHC/Utils/Logger.hs
- compiler/GHC/Utils/Misc.hs
- compiler/GHC/Utils/Monad/Codensity.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/GHC/Utils/Panic.hs
- compiler/GHC/Utils/Panic/Plain.hs
- compiler/GHC/Wasm/ControlFlow.hs
- compiler/GHC/Wasm/ControlFlow/FromCmm.hs
- compiler/Language/Haskell/Syntax.hs
- compiler/Language/Haskell/Syntax/Basic.hs
- compiler/Language/Haskell/Syntax/Binds.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/Expr.hs-boot
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- compiler/Language/Haskell/Syntax/Lit.hs
- compiler/Language/Haskell/Syntax/Pat.hs
- compiler/Language/Haskell/Syntax/Pat.hs-boot
- compiler/Language/Haskell/Syntax/Type.hs
- compiler/ghc.cabal.in
- configure.ac
- docs/users_guide/exts/gadt_syntax.rst
- docs/users_guide/ghci.rst
- docs/users_guide/phases.rst
- docs/users_guide/wasm.rst
- ghc/GHC/Driver/Session/Lint.hs
- ghc/GHC/Driver/Session/Mode.hs
- ghc/GHCi/Leak.hs
- ghc/GHCi/UI.hs
- ghc/GHCi/UI/Exception.hs
- ghc/GHCi/UI/Info.hs
- ghc/GHCi/UI/Monad.hs
- ghc/Main.hs
- ghc/ghc-bin.cabal.in
- hadrian/doc/flavours.md
- hadrian/src/Flavour.hs
- hadrian/src/Hadrian/Haskell/Cabal/Type.hs
- hadrian/src/Hadrian/Haskell/Hash.hs
- hadrian/src/Hadrian/Oracles/ArgsHash.hs
- hadrian/src/Hadrian/Oracles/Cabal/Type.hs
- hadrian/src/Hadrian/Oracles/DirectoryContents.hs
- hadrian/src/Hadrian/Oracles/Path.hs
- hadrian/src/Hadrian/Oracles/TextFile.hs
- hadrian/src/Hadrian/Utilities.hs
- hadrian/src/Oracles/Flavour.hs
- hadrian/src/Oracles/ModuleFiles.hs
- hadrian/src/Settings/Packages.hs
- libraries/base/changelog.md
- libraries/base/src/GHC/Num.hs
- libraries/exceptions
- libraries/ghc-internal/src/GHC/Internal/Control/Monad/ST/Lazy/Imp.hs
- libraries/ghc-internal/src/GHC/Internal/Data/OldList.hs
- libraries/ghc-internal/src/GHC/Internal/Functor/ZipList.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle.hs
- + rts/.ubsan-suppressions
- rts/Apply.cmm
- rts/Compact.cmm
- rts/ContinuationOps.cmm
- rts/Exception.cmm
- rts/Interpreter.c
- rts/Jumps.h
- rts/PrimOps.cmm
- rts/RtsMessages.c
- rts/StgMiscClosures.cmm
- rts/StgStartup.cmm
- rts/include/Stg.h
- rts/include/rts/Messages.h
- rts/include/stg/Types.h
- rts/linker/InitFini.c
- rts/prim/mulIntMayOflo.c
- rts/rts.cabal
- rts/sm/Sanity.c
- testsuite/driver/testglobals.py
- testsuite/driver/testlib.py
- + testsuite/tests/cmm/opt/T25664.hs
- + testsuite/tests/cmm/opt/T25664.stdout
- testsuite/tests/cmm/opt/all.T
- testsuite/tests/diagnostic-codes/codes.stdout
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/jsffi/all.T
- + testsuite/tests/jsffi/bytearrayarg.hs
- + testsuite/tests/jsffi/bytearrayarg.mjs
- + testsuite/tests/jsffi/bytearrayarg.stdout
- testsuite/tests/numeric/should_run/all.T
- testsuite/tests/numeric/should_run/foundation.hs
- testsuite/tests/numeric/should_run/foundation.stdout
- testsuite/tests/patsyn/should_fail/all.T
- + testsuite/tests/patsyn/should_fail/import-syntax-no-ext.hs
- + testsuite/tests/patsyn/should_fail/import-syntax-no-ext.stderr
- testsuite/tests/perf/should_run/all.T
- + testsuite/tests/rename/should_compile/T25901_sub_e.hs
- + testsuite/tests/rename/should_compile/T25901_sub_f.hs
- + testsuite/tests/rename/should_compile/T25901_sub_f.stderr
- + testsuite/tests/rename/should_compile/T25901_sub_g.hs
- + testsuite/tests/rename/should_compile/T25901_sub_g.stderr
- + testsuite/tests/rename/should_compile/T25901_sub_g_helper.hs
- testsuite/tests/rename/should_compile/all.T
- testsuite/tests/rename/should_fail/T23570b.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_a.hs
- + testsuite/tests/rename/should_fail/T25901_sub_a.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_b.hs
- + testsuite/tests/rename/should_fail/T25901_sub_b.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_c.hs
- + testsuite/tests/rename/should_fail/T25901_sub_c.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_c_helper.hs
- + testsuite/tests/rename/should_fail/T25901_sub_d.hs
- + testsuite/tests/rename/should_fail/T25901_sub_d.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_d_helper.hs
- + testsuite/tests/rename/should_fail/T25901_sub_w.hs
- + testsuite/tests/rename/should_fail/T25901_sub_w.stderr
- testsuite/tests/rename/should_fail/all.T
- + testsuite/tests/simd/should_run/T26411.hs
- + testsuite/tests/simd/should_run/T26411.stdout
- + testsuite/tests/simd/should_run/T26411b.hs
- + testsuite/tests/simd/should_run/T26411b.stdout
- testsuite/tests/simd/should_run/all.T
- testsuite/tests/simplStg/should_compile/all.T
- testsuite/tests/warnings/should_compile/DodgyExports03.stderr
- testsuite/tests/warnings/should_compile/DodgyImports.stderr
- + testsuite/tests/warnings/should_compile/DodgyImports02.hs
- + testsuite/tests/warnings/should_compile/DodgyImports02.stderr
- + testsuite/tests/warnings/should_compile/DodgyImports03.hs
- + testsuite/tests/warnings/should_compile/DodgyImports03.stderr
- + testsuite/tests/warnings/should_compile/DodgyImports03_helper.hs
- + testsuite/tests/warnings/should_compile/DodgyImports04.hs
- + testsuite/tests/warnings/should_compile/DodgyImports04.stderr
- testsuite/tests/warnings/should_compile/DodgyImports_hiding.stderr
- testsuite/tests/warnings/should_compile/all.T
- utils/check-exact/ExactPrint.hs
- utils/genapply/Main.hs
- utils/haddock/haddock-api/haddock-api.cabal
- − utils/haddock/haddock-api/src/Haddock/Backends/HaddockDB.hs
- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
- utils/haddock/html-test/ref/Bug1050.html
- utils/haddock/html-test/ref/LinearTypes.html
- utils/haddock/html-test/ref/PatternSyns.html
- + utils/haddock/html-test/ref/PatternSyns2.html
- utils/haddock/html-test/ref/TypeOperators.html
- + utils/haddock/html-test/src/PatternSyns2.hs
- utils/haddock/latex-test/ref/LinearTypes/LinearTypes.tex
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4e30456d9f9f54a6584d3af9b39e12…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4e30456d9f9f54a6584d3af9b39e12…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/romes/25636] Trying to work around the lazy IO unlifted business... hard.
by Rodrigo Mesquita (@alt-romes) 23 Dec '25
by Rodrigo Mesquita (@alt-romes) 23 Dec '25
23 Dec '25
Rodrigo Mesquita pushed to branch wip/romes/25636 at Glasgow Haskell Compiler / GHC
Commits:
94b4fed5 by Rodrigo Mesquita at 2025-12-22T20:08:56+00:00
Trying to work around the lazy IO unlifted business... hard.
test w/
./hadrian/build -j --flavour=perf+debug_ghc+no_profiled_libs+debug_info --only="T25636" --freeze1 test
- - - - -
8 changed files:
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Linker.hs
- compiler/GHC/ByteCode/Serialize.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Linker/Loader.hs
- libraries/ghci/GHCi/CreateBCO.hs
- libraries/ghci/GHCi/ResolvedBCO.hs
Changes:
=====================================
compiler/GHC/Builtin/primops.txt.pp
=====================================
@@ -3948,7 +3948,7 @@ primop NewBCOOp "newBCO#" GenPrimOp
out_of_line = True
primop NewConAppObjOp "newConAppObj#" GenPrimOp
- Addr# -> ByteArray# -> Array# a -> Word# -> State# s -> (# State# s, b #)
+ Addr# -> ByteArray# -> Array# a_levpoly -> Word# -> State# s -> (# State# s, b_levpoly #)
{ @'newConAppObj#' datacon_itbl lits ptrs arity@ creates a new constructor
application object on the heap from the info table pointer of the data
constructor and the data arguments given in @ptrs@ and @lits@. The
=====================================
compiler/GHC/ByteCode/Asm.hs
=====================================
@@ -43,6 +43,7 @@ import GHC.Utils.Outputable ( Outputable(..), text, (<+>), vcat )
import GHC.Utils.Panic
import GHC.Builtin.Types.Prim ( addrPrimTy )
+import GHC.Core.Type ( isUnliftedType )
import GHC.Core.TyCo.Compare ( eqType )
import GHC.Core.TyCon
import GHC.Data.SizedSeq
@@ -222,6 +223,7 @@ assembleBCO platform
, unlinkedStaticConDataConName = dataConName dc
, unlinkedStaticConLits = nonptrs
, unlinkedStaticConPtrs = ptrs
+ , unlinkedStaticConIsUnlifted = isUnliftedType (dataConRepType dc)
}
where
litBCOArg (Left l) = Just $ case literal platform l of
=====================================
compiler/GHC/ByteCode/Linker.hs
=====================================
@@ -15,6 +15,7 @@ module GHC.ByteCode.Linker
, lookupStaticPtr
, lookupIE
, linkFail
+ , BCOIx(..)
)
where
@@ -56,9 +57,9 @@ linkBCO
:: Interp
-> PkgsLoaded
-> BytecodeLoaderState
- -> NameEnv (Int, Bool)
- -- ^ A mapping from names to int references to other BCOs or Static Constructors in this group.
- -- The boolean identifies whether the referenced object is a BCO (when @True@) or a Static Constructor (when @False@)
+ -> NameEnv BCOIx
+ -- ^ A mapping from names to references to other BCOs
+ -- or static constructors in this group.
-> UnlinkedBCO
-> IO ResolvedBCO
linkBCO interp pkgs_loaded bytecode_state bco_ix unl_bco = do
@@ -80,6 +81,7 @@ linkBCO interp pkgs_loaded bytecode_state bco_ix unl_bco = do
{ unlinkedStaticConLits = lits0
, unlinkedStaticConPtrs = ptrs0
, unlinkedStaticConDataConName
+ , unlinkedStaticConIsUnlifted
} -> do
Ptr itbl_ptr# <- lookupIE interp pkgs_loaded bytecode_state unlinkedStaticConDataConName
lits <- doLits lits0
@@ -90,6 +92,7 @@ linkBCO interp pkgs_loaded bytecode_state bco_ix unl_bco = do
, resolvedStaticConArity = sizeFlatBag lits0 + sizeFlatBag ptrs0
, resolvedStaticConLits = lits
, resolvedStaticConPtrs = ptrs
+ , resolvedStaticConIsUnlifted = unlinkedStaticConIsUnlifted
}
where
doLits lits0 = do
@@ -99,6 +102,17 @@ linkBCO interp pkgs_loaded bytecode_state bco_ix unl_bco = do
doPtrs ptrs0 = addListToSS emptySS <$> do
mapM (resolvePtr interp pkgs_loaded bytecode_state bco_ix) (elemsFlatBag ptrs0)
+-- | An index into a BCO or Static Constructor in this group.
+--
+-- We distinguish between lifted and unlifted static constructors because
+-- lifted ones get resolved by tying a knot, since there may be circular
+-- dependencies between them, whereas unlifted ones get constructed in a first
+-- pass.
+data BCOIx = BCOIx !Int
+ | LiftedStaticConIx !Int
+ | UnliftedStaticConIx !Int
+ deriving (Eq, Ord, Show)
+
lookupLiteral :: Interp -> PkgsLoaded -> BytecodeLoaderState -> BCONPtr -> IO Word
lookupLiteral interp pkgs_loaded bytecode_state ptr = case ptr of
BCONPtrWord lit -> return lit
@@ -181,16 +195,16 @@ resolvePtr
:: Interp
-> PkgsLoaded
-> BytecodeLoaderState
- -> NameEnv (Int, Bool)
+ -> NameEnv BCOIx
-> BCOPtr
-> IO ResolvedBCOPtr
resolvePtr interp pkgs_loaded bco_loader_state bco_ix ptr = case ptr of
BCOPtrName nm
- | Just (ix, b) <- lookupNameEnv bco_ix nm
- -> if b then
- return (ResolvedBCORef ix) -- ref to another BCO in this group
- else
- return (ResolvedStaticConRef ix) -- ref to another StaticCon in this group
+ | Just bix <- lookupNameEnv bco_ix nm
+ -> return $ case bix of
+ BCOIx ix -> ResolvedBCORef ix
+ LiftedStaticConIx ix -> ResolvedStaticConRef ix
+ UnliftedStaticConIx ix -> ResolvedUnliftedStaticConRef ix
| Just (_, rhv) <- lookupNameBytecodeState bco_loader_state nm
-> return (ResolvedBCOPtr (unsafeForeignRefToRemoteRef rhv))
=====================================
compiler/GHC/ByteCode/Serialize.hs
=====================================
@@ -330,6 +330,7 @@ instance Binary UnlinkedBCO where
<*> getViaBinName bh
<*> get bh
<*> get bh
+ <*> get bh
_ -> panic "Binary UnlinkedBCO: invalid byte"
put_ bh UnlinkedBCO {..} = do
@@ -346,6 +347,7 @@ instance Binary UnlinkedBCO where
putViaBinName bh unlinkedStaticConDataConName
put_ bh unlinkedStaticConLits
put_ bh unlinkedStaticConPtrs
+ put_ bh unlinkedStaticConIsUnlifted
instance Binary BCOPtr where
get bh = do
=====================================
compiler/GHC/ByteCode/Types.hs
=====================================
@@ -265,7 +265,8 @@ data UnlinkedBCO
-- ('unlinkedStaticConDataConName')
unlinkedStaticConDataConName :: !Name,
unlinkedStaticConLits :: !(FlatBag BCONPtr), -- non-ptrs
- unlinkedStaticConPtrs :: !(FlatBag BCOPtr) -- ptrs
+ unlinkedStaticConPtrs :: !(FlatBag BCOPtr), -- ptrs
+ unlinkedStaticConIsUnlifted :: !Bool
}
instance NFData UnlinkedBCO where
@@ -328,8 +329,9 @@ instance Outputable UnlinkedBCO where
= sep [text "BCO", ppr nm, text "with",
ppr (sizeFlatBag lits), text "lits",
ppr (sizeFlatBag ptrs), text "ptrs" ]
- ppr (UnlinkedStaticCon nm dc_nm lits ptrs)
+ ppr (UnlinkedStaticCon nm dc_nm lits ptrs unl)
= sep [text "StaticCon", ppr nm, text "for",
+ if unl then text "unlifted" else text "lifted",
ppr dc_nm, text "with",
ppr (sizeFlatBag lits), text "lits",
ppr (sizeFlatBag ptrs), text "ptrs" ]
=====================================
compiler/GHC/Linker/Loader.hs
=====================================
@@ -1044,13 +1044,35 @@ linkSomeBCOs interp pkgs_loaded bytecode_state mods = foldr fun do_link mods []
do_link [] = return []
do_link mods = do
let flat = [ bco | bcos <- mods, bco <- bcos ]
- names = map (\case UnlinkedBCO{unlinkedBCOName} -> (unlinkedBCOName, True)
- UnlinkedStaticCon{unlinkedStaticConName} -> (unlinkedStaticConName, False)
- ) flat
- bco_ix = mkNameEnv (zipWith (\(n,isBCO) ix -> (n,(ix, isBCO))) names [0..])
+ unl_objs = filter isUnliftedObj flat
+ lif_objs = filter (not . isUnliftedObj) flat
+ unl_objs_ix = mkNameEnv (zipWith mkBCOIx [0..] unl_objs)
+ lif_objs_ix = mkNameEnv (zipWith mkBCOIx [0..] lif_objs)
+ bco_ix = plusNameEnv unl_objs_ix lif_objs_ix
resolved <- sequence [ linkBCO interp pkgs_loaded bytecode_state bco_ix bco | bco <- flat ]
- hvrefs <- {- pprTrace "CreatingBCOS" (ppr (zip [bco | bco <- flat] [(0::Int)..])) $ -} createBCOs interp resolved
- return (zipWith (\(n,_) hvr -> (n, hvr)) names hvrefs)
+ hvrefs <- createBCOs interp resolved
+ return (zip (map mkBCOName $ unl_objs ++ lif_objs) hvrefs)
+
+ mkBCOName UnlinkedBCO{unlinkedBCOName}
+ = unlinkedBCOName
+ mkBCOName UnlinkedStaticCon{unlinkedStaticConName}
+ = unlinkedStaticConName
+
+ mkBCOIx ix
+ UnlinkedBCO{unlinkedBCOName}
+ = (unlinkedBCOName, BCOIx ix)
+ mkBCOIx ix
+ UnlinkedStaticCon
+ { unlinkedStaticConName
+ , unlinkedStaticConIsUnlifted }
+ | unlinkedStaticConIsUnlifted
+ = (unlinkedStaticConName, UnliftedStaticConIx ix)
+ | otherwise
+ = (unlinkedStaticConName, LiftedStaticConIx ix)
+
+ isUnliftedObj = \case
+ UnlinkedStaticCon{..} -> unlinkedStaticConIsUnlifted
+ _ -> False
-- | Useful to apply to the result of 'linkSomeBCOs'
makeForeignNamedHValueRefs
=====================================
libraries/ghci/GHCi/CreateBCO.hs
=====================================
@@ -1,5 +1,8 @@
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
+{-# LANGUAGE UnliftedNewtypes #-}
+{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE MagicHash #-}
@@ -21,12 +24,13 @@ import GHCi.ResolvedBCO
import GHCi.RemoteTypes
import GHCi.BreakArray
import GHC.Data.SizedSeq
+import Data.List (partition)
import System.IO (fixIO)
import Control.Monad
import Data.Array.Base
import Foreign hiding (newArray)
-import Unsafe.Coerce (unsafeCoerce)
+import Unsafe.Coerce (unsafeCoerce, unsafeCoerceUnlifted)
import GHC.Arr ( Array(..) )
import GHC.Exts hiding ( BCO, mkApUpd0#, newBCO# )
import GHC.Internal.Base ( BCO, mkApUpd0#, newBCO# )
@@ -34,24 +38,43 @@ import GHC.IO
import Control.Exception ( ErrorCall(..) )
createBCOs :: [ResolvedBCO] -> IO [HValueRef]
-createBCOs bcos = do
+createBCOs objs = do
+
+ let (unl_objs, bcos) = partition isUnliftedObj objs
+
+ -- First, construct the array of unlifted static cons.
+ -- Top-level unlifted constructors are never mutual recursive, so we can do
+ -- this by filling the array on demand
+ -- (it's also not possible to define a mutually recursive unlifted
+ -- top-level value, see [GHC-20185]),
+ (unl_cons, unl_hvals) <- createUnliftedStaticCons unl_objs
+
+ -- Second, construct the lifted BCOs and static cons which may have
+ -- (circular) references to one another in this group. References from this
+ -- group to the unlifted static cons will be resolved by looking them up in
+ -- the array constructed in the first pass.
let n_bcos = length bcos
hvals <- fixIO $ \hvs -> do
let arr = listArray (0, n_bcos-1) hvs
- -- (BCO Index :-> HValue)
- mapM (createBCO arr) bcos
+ mapM (createBCO arr unl_cons) bcos
- mapM mkRemoteRef hvals
+ mapM mkRemoteRef (unl_hvals ++ hvals)
+
+ where
+ isUnliftedObj :: ResolvedBCO -> Bool
+ isUnliftedObj = \case
+ ResolvedStaticCon{..} -> resolvedStaticConIsUnlifted
+ _ -> False
-createBCO :: Array Int HValue -> ResolvedBCO -> IO HValue
-createBCO _ obj | resolvedBCOIsLE obj /= isLittleEndian
+createBCO :: Array Int HValue -> UnlConsArr -> ResolvedBCO -> IO HValue
+createBCO _ _ obj | resolvedBCOIsLE obj /= isLittleEndian
= throwIO (ErrorCall $
unlines [ "The endianness of the ResolvedBCO does not match"
, "the systems endianness. Using ghc and iserv in a"
, "mixed endianness setup is not supported!"
])
-createBCO arr bco
- = do linked_thing <- linkBCO' arr bco
+createBCO arr unl_arr bco
+ = do linked_thing <- linkBCO' arr unl_arr bco
case linked_thing of
LinkedBCO bco_arity linked_bco -> do
-- Note [Updatable CAF BCOs]
@@ -75,13 +98,45 @@ createBCO arr bco
return (HValue final_bco) }
LinkedStaticCon linked_static_con -> do
return linked_static_con
+ LinkedUnliftedStaticCon linked_static_con -> do
+ return $! forgetUnliftedHValue linked_static_con
+-- | The resulting of linking a BCO or static constructor
data LinkedBCO
= LinkedBCO !Int{-BCO arity-} BCO
| LinkedStaticCon HValue
+ | LinkedUnliftedStaticCon UnliftedHValue
-linkBCO' :: Array Int HValue -> ResolvedBCO -> IO LinkedBCO
-linkBCO' arr resolved_obj =
+-- | From a list of 'UnliftedStaticCon's, create an array of unlifted heap closures
+-- Invariant: All ResolvedBCOs are UnliftedStaticCons
+createUnliftedStaticCons :: [ResolvedBCO] -> IO (UnlConsArr, [HValue {- references to actually unlifted values, but we "forget" that -}])
+createUnliftedStaticCons objs = do
+ -- Ensure objs are topologically sorted by their dependencies
+ -- Then, just fill them in in order!
+ let !(I# arr_size#) = length objs
+ !(EmptyArr emp_arr#) = emptyArr
+ ucarr@(UnlConsArr unl_arr#) <- IO $ \s ->
+ case newArray# arr_size# (UnliftedHValue (unsafeCoerceUnlifted emp_arr#)) s of
+ (# s, arr #) -> (# s, UnlConsArr arr #)
+ vs <- forM (zip objs [0..]) $ \(obj, !(I# i#)) -> case obj of
+ ResolvedStaticCon{..}
+ | resolvedStaticConIsUnlifted
+ -> do
+ -- Because we topologically sort the objs, it's safe to assume all
+ -- references will already be filled in.
+ lbc <- linkBCO' (error "there should be no lifted dependencies for unlifted objs") ucarr obj
+ case lbc of
+ LinkedUnliftedStaticCon linked_static_con -> do
+ IO $ \s ->
+ case writeArray# unl_arr# i# linked_static_con s of
+ s -> (# s, forgetUnliftedHValue linked_static_con #)
+ _ -> error "createUnliftedStaticCons: unexpected lifted ResolvedBCO"
+ _ ->
+ error "createUnliftedStaticCons: unexpected lifted ResolvedBCO"
+ return (ucarr, vs)
+
+linkBCO' :: Array Int HValue -> UnlConsArr -> ResolvedBCO -> IO LinkedBCO
+linkBCO' arr unl_arr resolved_obj =
case resolved_obj of
ResolvedBCO{..} -> do
let
@@ -94,7 +149,7 @@ linkBCO' arr resolved_obj =
bitmap_barr = barr (getBCOByteArray resolvedBCOBitmap)
literals_barr = barr (getBCOByteArray resolvedBCOLits)
- PtrsArr marr <- mkPtrsArray arr n_ptrs ptrs
+ PtrsArr marr <- mkPtrsArray arr unl_arr n_ptrs ptrs
IO $ \s ->
case unsafeFreezeArray# marr s of { (# s, arr #) ->
case LinkedBCO resolvedBCOArity <$>
@@ -113,47 +168,69 @@ linkBCO' arr resolved_obj =
!(W# itbl_ptr_w#) = resolvedStaticConInfoPtr
!(Ptr itbl_ptr#) = Ptr (int2Addr# (word2Int# itbl_ptr_w#))
- PtrsArr marr <- mkPtrsArray arr n_ptrs ptrs
+ PtrsArr marr <- mkPtrsArray arr unl_arr n_ptrs ptrs
IO $ \s ->
case unsafeFreezeArray# marr s of { (# s, arr #) ->
case newConAppObj# itbl_ptr# literals_barr arr data_size# s of
- (# s, hval #) -> (# s, LinkedStaticCon (HValue hval) #)
+ (# s, hval #) ->
+ (# s, if resolvedStaticConIsUnlifted then
+ LinkedUnliftedStaticCon (UnliftedHValue (unsafeCoerce# hval))
+ else
+ LinkedStaticCon (HValue hval) #)
}
where
!(EmptyArr empty#) = emptyArr -- See Note [BCO empty array]
barr arr# = if I# (sizeofByteArray# arr#) == 0 then empty# else arr#
-- we recursively link any sub-BCOs while making the ptrs array
-mkPtrsArray :: Array Int HValue -> Word -> [ResolvedBCOPtr] -> IO PtrsArr
-mkPtrsArray arr n_ptrs ptrs = do
+mkPtrsArray :: Array Int HValue -> UnlConsArr -> Word -> [ResolvedBCOPtr] -> IO PtrsArr
+mkPtrsArray arr (UnlConsArr unl_arr) n_ptrs ptrs = do
marr <- newPtrsArray (fromIntegral n_ptrs)
let
fill (ResolvedBCORef n) i =
- writePtrsArrayHValue i (arr ! n{-thunk which returns the HValue by looking it up in the arr which is captured by the thunk-}) marr -- must be lazy!
+ writePtrsArrayHValue i (arr ! n) marr -- must be lazy!
fill (ResolvedStaticConRef n) i = do
- -- this MUST be /strict/!
- -- the static con reference must be an evaluated pointer to the data con
- -- info table, but (arr ! n) would construct a thunk instead if unforced.
- writePtrsArrayHValue i (arr ! n) marr
+ writePtrsArrayHValue i (arr ! n) marr -- must be lazy!
+ fill (ResolvedUnliftedStaticConRef !(I# n#)) i = do
+ -- must be strict! we want to store the unlifted con,
+ -- not the arr indexing thunk.
+ !unl_val <- IO $ \s ->
+ case readArray# unl_arr n# s of
+ (# s, val #) -> (# s, forgetUnliftedHValue val #)
+ writePtrsArrayHValue i unl_val marr
fill (ResolvedBCOPtr r) i = do
hv <- localRef r
writePtrsArrayHValue i hv marr
fill (ResolvedBCOStaticPtr r) i = do
writePtrsArrayPtr i (fromRemotePtr r) marr
fill (ResolvedBCOPtrBCO bco) i = do
- obj <- linkBCO' arr bco
+ obj <- linkBCO' arr (UnlConsArr unl_arr) bco
case obj of
LinkedBCO _ bco ->
writePtrsArrayBCO i bco marr
- LinkedStaticCon !linked_static_con ->
+ LinkedStaticCon linked_static_con ->
writePtrsArrayHValue i linked_static_con marr
+ LinkedUnliftedStaticCon linked_static_con -> do
+ let !unl_val = forgetUnliftedHValue linked_static_con
+ writePtrsArrayHValue i unl_val marr
fill (ResolvedBCOPtrBreakArray r) i = do
BA mba <- localRef r
writePtrsArrayMBA i mba marr
zipWithM_ fill ptrs [0..]
return marr
+-- | A heap closure of unlifted type
+type UnliftedHValue :: UnliftedType
+newtype UnliftedHValue = UnliftedHValue (Any @UnliftedType)
+
+-- | Forget that a heap closure is unlifted, and return it as a lifted heap closure.
+forgetUnliftedHValue :: UnliftedHValue -> HValue
+forgetUnliftedHValue (UnliftedHValue a) = HValue (unsafeCoerce# a)
+
+-- | A lifted array with unlifted static constructor 'UnliftedHValue's
+data UnlConsArr = UnlConsArr (MutableArray# RealWorld UnliftedHValue)
+
data PtrsArr = PtrsArr (MutableArray# RealWorld HValue)
newPtrsArray :: Int -> IO PtrsArr
=====================================
libraries/ghci/GHCi/ResolvedBCO.hs
=====================================
@@ -54,7 +54,8 @@ data ResolvedBCO
resolvedStaticConInfoPtr :: {-# UNPACK #-} !Word, -- ^ info ptr Addr# as a Word
resolvedStaticConArity :: {-# UNPACK #-} !Word,
resolvedStaticConLits :: BCOByteArray Word,
- resolvedStaticConPtrs :: SizedSeq ResolvedBCOPtr
+ resolvedStaticConPtrs :: SizedSeq ResolvedBCOPtr,
+ resolvedStaticConIsUnlifted :: Bool
}
deriving (Generic, Show)
@@ -103,11 +104,12 @@ instance Binary ResolvedBCO where
put resolvedStaticConArity
put resolvedStaticConLits
put resolvedStaticConPtrs
+ put resolvedStaticConIsUnlifted
get = do
t <- getWord8
case t of
0 -> ResolvedBCO <$> get <*> get <*> get <*> get <*> get <*> get
- 1 -> ResolvedStaticCon <$> get <*> get <*> get <*> get <*> get
+ 1 -> ResolvedStaticCon <$> get <*> get <*> get <*> get <*> get <*> get
_ -> error "Binary ResolvedBCO: invalid byte"
-- See Note [BCOByteArray serialization]
@@ -118,7 +120,8 @@ instance (Binary a, Storable a, IArray UArray a) => Binary (BCOByteArray a) wher
data ResolvedBCOPtr
= ResolvedBCORef {-# UNPACK #-} !Int
- -- ^ reference to the Nth BCO in the current set
+ -- ^ reference to the Nth BCO in the current set of BCOs and
+ -- lifted static constructors
| ResolvedBCOPtr {-# UNPACK #-} !(RemoteRef HValue)
-- ^ reference to a previously created BCO
| ResolvedBCOStaticPtr {-# UNPACK #-} !(RemotePtr ())
@@ -128,7 +131,11 @@ data ResolvedBCOPtr
| ResolvedBCOPtrBreakArray {-# UNPACK #-} !(RemoteRef BreakArray)
-- ^ Resolves to the MutableArray# inside the BreakArray
| ResolvedStaticConRef {-# UNPACK #-} !Int
- -- ^ reference to the Nth static constructor in the current set
+ -- ^ reference to the Nth static constructor in the current set of BCOs
+ -- and lifted static constructors
+ | ResolvedUnliftedStaticConRef {-# UNPACK #-} !Int
+ -- ^ reference to the Nth unlifted static constructor in the current set
+ -- of exclusively unlifted static constructors
deriving (Generic, Show)
instance Binary ResolvedBCOPtr
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/94b4fed57d01fea75428b7ada80b6aa…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/94b4fed57d01fea75428b7ada80b6aa…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
23 Dec '25
Rodrigo Mesquita pushed to branch wip/romes/25636 at Glasgow Haskell Compiler / GHC
Commits:
c1e26acd by Rodrigo Mesquita at 2025-12-22T17:13:48+00:00
wIPW
- - - - -
98234f97 by Rodrigo Mesquita at 2025-12-22T20:08:31+00:00
Trying to work around the lazy IO unlifted business... hard.
- - - - -
8 changed files:
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Linker.hs
- compiler/GHC/ByteCode/Serialize.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Linker/Loader.hs
- libraries/ghci/GHCi/CreateBCO.hs
- libraries/ghci/GHCi/ResolvedBCO.hs
Changes:
=====================================
compiler/GHC/Builtin/primops.txt.pp
=====================================
@@ -3948,7 +3948,7 @@ primop NewBCOOp "newBCO#" GenPrimOp
out_of_line = True
primop NewConAppObjOp "newConAppObj#" GenPrimOp
- Addr# -> ByteArray# -> Array# a -> Word# -> State# s -> (# State# s, b #)
+ Addr# -> ByteArray# -> Array# a_levpoly -> Word# -> State# s -> (# State# s, b_levpoly #)
{ @'newConAppObj#' datacon_itbl lits ptrs arity@ creates a new constructor
application object on the heap from the info table pointer of the data
constructor and the data arguments given in @ptrs@ and @lits@. The
=====================================
compiler/GHC/ByteCode/Asm.hs
=====================================
@@ -43,6 +43,7 @@ import GHC.Utils.Outputable ( Outputable(..), text, (<+>), vcat )
import GHC.Utils.Panic
import GHC.Builtin.Types.Prim ( addrPrimTy )
+import GHC.Core.Type ( isUnliftedType )
import GHC.Core.TyCo.Compare ( eqType )
import GHC.Core.TyCon
import GHC.Data.SizedSeq
@@ -222,6 +223,7 @@ assembleBCO platform
, unlinkedStaticConDataConName = dataConName dc
, unlinkedStaticConLits = nonptrs
, unlinkedStaticConPtrs = ptrs
+ , unlinkedStaticConIsUnlifted = isUnliftedType (dataConRepType dc)
}
where
litBCOArg (Left l) = Just $ case literal platform l of
=====================================
compiler/GHC/ByteCode/Linker.hs
=====================================
@@ -15,6 +15,7 @@ module GHC.ByteCode.Linker
, lookupStaticPtr
, lookupIE
, linkFail
+ , BCOIx(..)
)
where
@@ -56,9 +57,9 @@ linkBCO
:: Interp
-> PkgsLoaded
-> BytecodeLoaderState
- -> NameEnv (Int, Bool)
- -- ^ A mapping from names to int references to other BCOs or Static Constructors in this group.
- -- The boolean identifies whether the referenced object is a BCO (when @True@) or a Static Constructor (when @False@)
+ -> NameEnv BCOIx
+ -- ^ A mapping from names to references to other BCOs
+ -- or static constructors in this group.
-> UnlinkedBCO
-> IO ResolvedBCO
linkBCO interp pkgs_loaded bytecode_state bco_ix unl_bco = do
@@ -80,6 +81,7 @@ linkBCO interp pkgs_loaded bytecode_state bco_ix unl_bco = do
{ unlinkedStaticConLits = lits0
, unlinkedStaticConPtrs = ptrs0
, unlinkedStaticConDataConName
+ , unlinkedStaticConIsUnlifted
} -> do
Ptr itbl_ptr# <- lookupIE interp pkgs_loaded bytecode_state unlinkedStaticConDataConName
lits <- doLits lits0
@@ -90,6 +92,7 @@ linkBCO interp pkgs_loaded bytecode_state bco_ix unl_bco = do
, resolvedStaticConArity = sizeFlatBag lits0 + sizeFlatBag ptrs0
, resolvedStaticConLits = lits
, resolvedStaticConPtrs = ptrs
+ , resolvedStaticConIsUnlifted = unlinkedStaticConIsUnlifted
}
where
doLits lits0 = do
@@ -99,6 +102,17 @@ linkBCO interp pkgs_loaded bytecode_state bco_ix unl_bco = do
doPtrs ptrs0 = addListToSS emptySS <$> do
mapM (resolvePtr interp pkgs_loaded bytecode_state bco_ix) (elemsFlatBag ptrs0)
+-- | An index into a BCO or Static Constructor in this group.
+--
+-- We distinguish between lifted and unlifted static constructors because
+-- lifted ones get resolved by tying a knot, since there may be circular
+-- dependencies between them, whereas unlifted ones get constructed in a first
+-- pass.
+data BCOIx = BCOIx !Int
+ | LiftedStaticConIx !Int
+ | UnliftedStaticConIx !Int
+ deriving (Eq, Ord, Show)
+
lookupLiteral :: Interp -> PkgsLoaded -> BytecodeLoaderState -> BCONPtr -> IO Word
lookupLiteral interp pkgs_loaded bytecode_state ptr = case ptr of
BCONPtrWord lit -> return lit
@@ -181,16 +195,16 @@ resolvePtr
:: Interp
-> PkgsLoaded
-> BytecodeLoaderState
- -> NameEnv (Int, Bool)
+ -> NameEnv BCOIx
-> BCOPtr
-> IO ResolvedBCOPtr
resolvePtr interp pkgs_loaded bco_loader_state bco_ix ptr = case ptr of
BCOPtrName nm
- | Just (ix, b) <- lookupNameEnv bco_ix nm
- -> if b then
- return (ResolvedBCORef ix) -- ref to another BCO in this group
- else
- return (ResolvedStaticConRef ix) -- ref to another StaticCon in this group
+ | Just bix <- lookupNameEnv bco_ix nm
+ -> return $ case bix of
+ BCOIx ix -> ResolvedBCORef ix
+ LiftedStaticConIx ix -> ResolvedStaticConRef ix
+ UnliftedStaticConIx ix -> ResolvedUnliftedStaticConRef ix
| Just (_, rhv) <- lookupNameBytecodeState bco_loader_state nm
-> return (ResolvedBCOPtr (unsafeForeignRefToRemoteRef rhv))
=====================================
compiler/GHC/ByteCode/Serialize.hs
=====================================
@@ -330,6 +330,7 @@ instance Binary UnlinkedBCO where
<*> getViaBinName bh
<*> get bh
<*> get bh
+ <*> get bh
_ -> panic "Binary UnlinkedBCO: invalid byte"
put_ bh UnlinkedBCO {..} = do
@@ -346,6 +347,7 @@ instance Binary UnlinkedBCO where
putViaBinName bh unlinkedStaticConDataConName
put_ bh unlinkedStaticConLits
put_ bh unlinkedStaticConPtrs
+ put_ bh unlinkedStaticConIsUnlifted
instance Binary BCOPtr where
get bh = do
=====================================
compiler/GHC/ByteCode/Types.hs
=====================================
@@ -265,7 +265,8 @@ data UnlinkedBCO
-- ('unlinkedStaticConDataConName')
unlinkedStaticConDataConName :: !Name,
unlinkedStaticConLits :: !(FlatBag BCONPtr), -- non-ptrs
- unlinkedStaticConPtrs :: !(FlatBag BCOPtr) -- ptrs
+ unlinkedStaticConPtrs :: !(FlatBag BCOPtr), -- ptrs
+ unlinkedStaticConIsUnlifted :: !Bool
}
instance NFData UnlinkedBCO where
@@ -328,8 +329,9 @@ instance Outputable UnlinkedBCO where
= sep [text "BCO", ppr nm, text "with",
ppr (sizeFlatBag lits), text "lits",
ppr (sizeFlatBag ptrs), text "ptrs" ]
- ppr (UnlinkedStaticCon nm dc_nm lits ptrs)
+ ppr (UnlinkedStaticCon nm dc_nm lits ptrs unl)
= sep [text "StaticCon", ppr nm, text "for",
+ if unl then text "unlifted" else text "lifted",
ppr dc_nm, text "with",
ppr (sizeFlatBag lits), text "lits",
ppr (sizeFlatBag ptrs), text "ptrs" ]
=====================================
compiler/GHC/Linker/Loader.hs
=====================================
@@ -1044,13 +1044,35 @@ linkSomeBCOs interp pkgs_loaded bytecode_state mods = foldr fun do_link mods []
do_link [] = return []
do_link mods = do
let flat = [ bco | bcos <- mods, bco <- bcos ]
- names = map (\case UnlinkedBCO{unlinkedBCOName} -> (unlinkedBCOName, True)
- UnlinkedStaticCon{unlinkedStaticConName} -> (unlinkedStaticConName, False)
- ) flat
- bco_ix = mkNameEnv (zipWith (\(n,isBCO) ix -> (n,(ix, isBCO))) names [0..])
+ unl_objs = filter isUnliftedObj flat
+ lif_objs = filter (not . isUnliftedObj) flat
+ unl_objs_ix = mkNameEnv (zipWith mkBCOIx [0..] unl_objs)
+ lif_objs_ix = mkNameEnv (zipWith mkBCOIx [0..] lif_objs)
+ bco_ix = plusNameEnv unl_objs_ix lif_objs_ix
resolved <- sequence [ linkBCO interp pkgs_loaded bytecode_state bco_ix bco | bco <- flat ]
- hvrefs <- {- pprTrace "CreatingBCOS" (ppr (zip [bco | bco <- flat] [(0::Int)..])) $ -} createBCOs interp resolved
- return (zipWith (\(n,_) hvr -> (n, hvr)) names hvrefs)
+ hvrefs <- createBCOs interp resolved
+ return (zip (map mkBCOName $ unl_objs ++ lif_objs) hvrefs)
+
+ mkBCOName UnlinkedBCO{unlinkedBCOName}
+ = unlinkedBCOName
+ mkBCOName UnlinkedStaticCon{unlinkedStaticConName}
+ = unlinkedStaticConName
+
+ mkBCOIx ix
+ UnlinkedBCO{unlinkedBCOName}
+ = (unlinkedBCOName, BCOIx ix)
+ mkBCOIx ix
+ UnlinkedStaticCon
+ { unlinkedStaticConName
+ , unlinkedStaticConIsUnlifted }
+ | unlinkedStaticConIsUnlifted
+ = (unlinkedStaticConName, UnliftedStaticConIx ix)
+ | otherwise
+ = (unlinkedStaticConName, LiftedStaticConIx ix)
+
+ isUnliftedObj = \case
+ UnlinkedStaticCon{..} -> unlinkedStaticConIsUnlifted
+ _ -> False
-- | Useful to apply to the result of 'linkSomeBCOs'
makeForeignNamedHValueRefs
=====================================
libraries/ghci/GHCi/CreateBCO.hs
=====================================
@@ -1,5 +1,8 @@
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
+{-# LANGUAGE UnliftedNewtypes #-}
+{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE MagicHash #-}
@@ -21,12 +24,13 @@ import GHCi.ResolvedBCO
import GHCi.RemoteTypes
import GHCi.BreakArray
import GHC.Data.SizedSeq
+import Data.List (partition)
import System.IO (fixIO)
import Control.Monad
import Data.Array.Base
import Foreign hiding (newArray)
-import Unsafe.Coerce (unsafeCoerce)
+import Unsafe.Coerce (unsafeCoerce, unsafeCoerceUnlifted)
import GHC.Arr ( Array(..) )
import GHC.Exts hiding ( BCO, mkApUpd0#, newBCO# )
import GHC.Internal.Base ( BCO, mkApUpd0#, newBCO# )
@@ -34,31 +38,43 @@ import GHC.IO
import Control.Exception ( ErrorCall(..) )
createBCOs :: [ResolvedBCO] -> IO [HValueRef]
-createBCOs bcos = do
+createBCOs objs = do
+
+ let (unl_objs, bcos) = partition isUnliftedObj objs
+
+ -- First, construct the array of unlifted static cons.
+ -- Top-level unlifted constructors are never mutual recursive, so we can do
+ -- this by filling the array on demand
+ -- (it's also not possible to define a mutually recursive unlifted
+ -- top-level value, see [GHC-20185]),
+ (unl_cons, unl_hvals) <- createUnliftedStaticCons unl_objs
+
+ -- Second, construct the lifted BCOs and static cons which may have
+ -- (circular) references to one another in this group. References from this
+ -- group to the unlifted static cons will be resolved by looking them up in
+ -- the array constructed in the first pass.
let n_bcos = length bcos
hvals <- fixIO $ \hvs -> do
let arr = listArray (0, n_bcos-1) hvs
- mapM (createBCO arr) bcos
- -- Force all StaticConRefs! They must definitely not be thunks!
- -- See Note ...
- -- This doesn't work. We need to force the thunk which is written into the Ptrs array
- zipWithM (\bco hval ->
- case bco of
- ResolvedBCO{} ->
- mkRemoteRef hval
- ResolvedStaticCon{} ->
- hval `seq` mkRemoteRef hval
- ) bcos hvals
-
-createBCO :: Array Int HValue -> ResolvedBCO -> IO HValue
-createBCO _ obj | resolvedBCOIsLE obj /= isLittleEndian
+ mapM (createBCO arr unl_cons) bcos
+
+ mapM mkRemoteRef (unl_hvals ++ hvals)
+
+ where
+ isUnliftedObj :: ResolvedBCO -> Bool
+ isUnliftedObj = \case
+ ResolvedStaticCon{..} -> resolvedStaticConIsUnlifted
+ _ -> False
+
+createBCO :: Array Int HValue -> UnlConsArr -> ResolvedBCO -> IO HValue
+createBCO _ _ obj | resolvedBCOIsLE obj /= isLittleEndian
= throwIO (ErrorCall $
unlines [ "The endianness of the ResolvedBCO does not match"
, "the systems endianness. Using ghc and iserv in a"
, "mixed endianness setup is not supported!"
])
-createBCO arr bco
- = do linked_thing <- linkBCO' arr bco
+createBCO arr unl_arr bco
+ = do linked_thing <- linkBCO' arr unl_arr bco
case linked_thing of
LinkedBCO bco_arity linked_bco -> do
-- Note [Updatable CAF BCOs]
@@ -82,13 +98,45 @@ createBCO arr bco
return (HValue final_bco) }
LinkedStaticCon linked_static_con -> do
return linked_static_con
+ LinkedUnliftedStaticCon linked_static_con -> do
+ return $! forgetUnliftedHValue linked_static_con
+-- | The resulting of linking a BCO or static constructor
data LinkedBCO
= LinkedBCO !Int{-BCO arity-} BCO
| LinkedStaticCon HValue
+ | LinkedUnliftedStaticCon UnliftedHValue
+
+-- | From a list of 'UnliftedStaticCon's, create an array of unlifted heap closures
+-- Invariant: All ResolvedBCOs are UnliftedStaticCons
+createUnliftedStaticCons :: [ResolvedBCO] -> IO (UnlConsArr, [HValue {- references to actually unlifted values, but we "forget" that -}])
+createUnliftedStaticCons objs = do
+ -- Ensure objs are topologically sorted by their dependencies
+ -- Then, just fill them in in order!
+ let !(I# arr_size#) = length objs
+ !(EmptyArr emp_arr#) = emptyArr
+ ucarr@(UnlConsArr unl_arr#) <- IO $ \s ->
+ case newArray# arr_size# (UnliftedHValue (unsafeCoerceUnlifted emp_arr#)) s of
+ (# s, arr #) -> (# s, UnlConsArr arr #)
+ vs <- forM (zip objs [0..]) $ \(obj, !(I# i#)) -> case obj of
+ ResolvedStaticCon{..}
+ | resolvedStaticConIsUnlifted
+ -> do
+ -- Because we topologically sort the objs, it's safe to assume all
+ -- references will already be filled in.
+ lbc <- linkBCO' (error "there should be no lifted dependencies for unlifted objs") ucarr obj
+ case lbc of
+ LinkedUnliftedStaticCon linked_static_con -> do
+ IO $ \s ->
+ case writeArray# unl_arr# i# linked_static_con s of
+ s -> (# s, forgetUnliftedHValue linked_static_con #)
+ _ -> error "createUnliftedStaticCons: unexpected lifted ResolvedBCO"
+ _ ->
+ error "createUnliftedStaticCons: unexpected lifted ResolvedBCO"
+ return (ucarr, vs)
-linkBCO' :: Array Int HValue -> ResolvedBCO -> IO LinkedBCO
-linkBCO' arr resolved_obj =
+linkBCO' :: Array Int HValue -> UnlConsArr -> ResolvedBCO -> IO LinkedBCO
+linkBCO' arr unl_arr resolved_obj =
case resolved_obj of
ResolvedBCO{..} -> do
let
@@ -101,7 +149,7 @@ linkBCO' arr resolved_obj =
bitmap_barr = barr (getBCOByteArray resolvedBCOBitmap)
literals_barr = barr (getBCOByteArray resolvedBCOLits)
- PtrsArr marr <- mkPtrsArray arr n_ptrs ptrs
+ PtrsArr marr <- mkPtrsArray arr unl_arr n_ptrs ptrs
IO $ \s ->
case unsafeFreezeArray# marr s of { (# s, arr #) ->
case LinkedBCO resolvedBCOArity <$>
@@ -120,47 +168,69 @@ linkBCO' arr resolved_obj =
!(W# itbl_ptr_w#) = resolvedStaticConInfoPtr
!(Ptr itbl_ptr#) = Ptr (int2Addr# (word2Int# itbl_ptr_w#))
- PtrsArr marr <- mkPtrsArray arr n_ptrs ptrs
+ PtrsArr marr <- mkPtrsArray arr unl_arr n_ptrs ptrs
IO $ \s ->
case unsafeFreezeArray# marr s of { (# s, arr #) ->
case newConAppObj# itbl_ptr# literals_barr arr data_size# s of
- (# s, !hval #) -> (# s, LinkedStaticCon (HValue hval) #)
+ (# s, hval #) ->
+ (# s, if resolvedStaticConIsUnlifted then
+ LinkedUnliftedStaticCon (UnliftedHValue (unsafeCoerce# hval))
+ else
+ LinkedStaticCon (HValue hval) #)
}
where
!(EmptyArr empty#) = emptyArr -- See Note [BCO empty array]
barr arr# = if I# (sizeofByteArray# arr#) == 0 then empty# else arr#
-- we recursively link any sub-BCOs while making the ptrs array
-mkPtrsArray :: Array Int HValue -> Word -> [ResolvedBCOPtr] -> IO PtrsArr
-mkPtrsArray arr n_ptrs ptrs = do
+mkPtrsArray :: Array Int HValue -> UnlConsArr -> Word -> [ResolvedBCOPtr] -> IO PtrsArr
+mkPtrsArray arr (UnlConsArr unl_arr) n_ptrs ptrs = do
marr <- newPtrsArray (fromIntegral n_ptrs)
let
fill (ResolvedBCORef n) i =
writePtrsArrayHValue i (arr ! n) marr -- must be lazy!
fill (ResolvedStaticConRef n) i = do
- -- this MUST be /strict/!
- -- the static con reference must be an evaluated pointer to the data con
- -- info table, but (arr ! n) would construct a thunk instead if unforced.
- writePtrsArrayHValue i (arr ! n) marr
+ writePtrsArrayHValue i (arr ! n) marr -- must be lazy!
+ fill (ResolvedUnliftedStaticConRef !(I# n#)) i = do
+ -- must be strict! we want to store the unlifted con,
+ -- not the arr indexing thunk.
+ !unl_val <- IO $ \s ->
+ case readArray# unl_arr n# s of
+ (# s, val #) -> (# s, forgetUnliftedHValue val #)
+ writePtrsArrayHValue i unl_val marr
fill (ResolvedBCOPtr r) i = do
hv <- localRef r
writePtrsArrayHValue i hv marr
fill (ResolvedBCOStaticPtr r) i = do
writePtrsArrayPtr i (fromRemotePtr r) marr
fill (ResolvedBCOPtrBCO bco) i = do
- obj <- linkBCO' arr bco
+ obj <- linkBCO' arr (UnlConsArr unl_arr) bco
case obj of
LinkedBCO _ bco ->
writePtrsArrayBCO i bco marr
- LinkedStaticCon !linked_static_con ->
+ LinkedStaticCon linked_static_con ->
writePtrsArrayHValue i linked_static_con marr
+ LinkedUnliftedStaticCon linked_static_con -> do
+ let !unl_val = forgetUnliftedHValue linked_static_con
+ writePtrsArrayHValue i unl_val marr
fill (ResolvedBCOPtrBreakArray r) i = do
BA mba <- localRef r
writePtrsArrayMBA i mba marr
zipWithM_ fill ptrs [0..]
return marr
+-- | A heap closure of unlifted type
+type UnliftedHValue :: UnliftedType
+newtype UnliftedHValue = UnliftedHValue (Any @UnliftedType)
+
+-- | Forget that a heap closure is unlifted, and return it as a lifted heap closure.
+forgetUnliftedHValue :: UnliftedHValue -> HValue
+forgetUnliftedHValue (UnliftedHValue a) = HValue (unsafeCoerce# a)
+
+-- | A lifted array with unlifted static constructor 'UnliftedHValue's
+data UnlConsArr = UnlConsArr (MutableArray# RealWorld UnliftedHValue)
+
data PtrsArr = PtrsArr (MutableArray# RealWorld HValue)
newPtrsArray :: Int -> IO PtrsArr
=====================================
libraries/ghci/GHCi/ResolvedBCO.hs
=====================================
@@ -54,7 +54,8 @@ data ResolvedBCO
resolvedStaticConInfoPtr :: {-# UNPACK #-} !Word, -- ^ info ptr Addr# as a Word
resolvedStaticConArity :: {-# UNPACK #-} !Word,
resolvedStaticConLits :: BCOByteArray Word,
- resolvedStaticConPtrs :: SizedSeq ResolvedBCOPtr
+ resolvedStaticConPtrs :: SizedSeq ResolvedBCOPtr,
+ resolvedStaticConIsUnlifted :: Bool
}
deriving (Generic, Show)
@@ -103,11 +104,12 @@ instance Binary ResolvedBCO where
put resolvedStaticConArity
put resolvedStaticConLits
put resolvedStaticConPtrs
+ put resolvedStaticConIsUnlifted
get = do
t <- getWord8
case t of
0 -> ResolvedBCO <$> get <*> get <*> get <*> get <*> get <*> get
- 1 -> ResolvedStaticCon <$> get <*> get <*> get <*> get <*> get
+ 1 -> ResolvedStaticCon <$> get <*> get <*> get <*> get <*> get <*> get
_ -> error "Binary ResolvedBCO: invalid byte"
-- See Note [BCOByteArray serialization]
@@ -118,7 +120,8 @@ instance (Binary a, Storable a, IArray UArray a) => Binary (BCOByteArray a) wher
data ResolvedBCOPtr
= ResolvedBCORef {-# UNPACK #-} !Int
- -- ^ reference to the Nth BCO in the current set
+ -- ^ reference to the Nth BCO in the current set of BCOs and
+ -- lifted static constructors
| ResolvedBCOPtr {-# UNPACK #-} !(RemoteRef HValue)
-- ^ reference to a previously created BCO
| ResolvedBCOStaticPtr {-# UNPACK #-} !(RemotePtr ())
@@ -128,7 +131,11 @@ data ResolvedBCOPtr
| ResolvedBCOPtrBreakArray {-# UNPACK #-} !(RemoteRef BreakArray)
-- ^ Resolves to the MutableArray# inside the BreakArray
| ResolvedStaticConRef {-# UNPACK #-} !Int
- -- ^ reference to the Nth static constructor in the current set
+ -- ^ reference to the Nth static constructor in the current set of BCOs
+ -- and lifted static constructors
+ | ResolvedUnliftedStaticConRef {-# UNPACK #-} !Int
+ -- ^ reference to the Nth unlifted static constructor in the current set
+ -- of exclusively unlifted static constructors
deriving (Generic, Show)
instance Binary ResolvedBCOPtr
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f0ce9444d07f7a59593c69b5ee3acb…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f0ce9444d07f7a59593c69b5ee3acb…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/romes/hadrian-cross-stage2-rebase_SVEN_FINAL] 8 commits: hadrian: Build stage 2 cross compilers
by Sven Tennie (@supersven) 22 Dec '25
by Sven Tennie (@supersven) 22 Dec '25
22 Dec '25
Sven Tennie pushed to branch wip/romes/hadrian-cross-stage2-rebase_SVEN_FINAL at Glasgow Haskell Compiler / GHC
Commits:
8fc32dc7 by Matthew Pickering at 2025-12-22T19:18:35+01:00
hadrian: Build stage 2 cross compilers
* Most of hadrian is abstracted over the stage in order to remove the
assumption that the target of all stages is the same platform. This
allows the RTS to be built for two different targets for example.
* Abstracts the bindist creation logic to allow building either normal
or cross bindists. Normal bindists use stage 1 libraries and a stage 2
compiler. Cross bindists use stage 2 libararies and a stage 2
compiler.
* hadrian: Make binary-dist-dir the default build target. This allows us
to have the logic in one place about which libraries/stages to build
with cross compilers. Fixes #24192
New hadrian target:
* `binary-dist-dir-cross`: Build a cross compiler bindist (compiler =
stage 1, libraries = stage 2)
This commit also contains various changes to make stage2 compilers
feasible.
-------------------------
Metric Decrease:
ManyAlternatives
MultiComponentModulesRecomp
MultiLayerModulesRecomp
T10421
T12425
T12707
T13035
T13379
T15703
T16577
T18698a
T18698b
T18923
T1969
T21839c
T3294
T4801
T5030
T5321Fun
T5642
T783
T9198
T9872d
T9961
parsing001
-------------------------
Co-authored-by: Sven Tennie <sven.tennie(a)gmail.com>
- - - - -
828b3cef by Sven Tennie at 2025-12-22T19:18:53+01:00
Align CI scripts with master
Fixup
- - - - -
80343e0b by Matthew Pickering at 2025-12-22T19:18:53+01:00
ci: Test cross bindists
We remove the special logic for testing in-tree cross
compilers and instead test cross compiler bindists, like we do for all
other platforms.
- - - - -
0d0826e9 by Matthew Pickering at 2025-12-22T19:18:53+01:00
ci: Javascript don't set CROSS_EMULATOR
There is no CROSS_EMULATOR needed to run javascript binaries, so we
don't set the CROSS_EMULATOR to some dummy value.
- - - - -
eeadc70e by Matthew Pickering at 2025-12-22T19:18:53+01:00
ci: Introduce CROSS_STAGE variable
In preparation for building and testing stage3 bindists we introduce the
CROSS_STAGE variable which is used by a CI job to determine what kind of
bindist the CI job should produce.
At the moment we are only using CROSS_STAGE=2 but in the future we will
have some jobs which set CROSS_STAGE=3 to produce native bindists for a
target, but produced by a cross compiler, which can be tested on by
another CI job on the native platform.
CROSS_STAGE=2: Build a normal cross compiler bindist
CROSS_STAGE=3: Build a stage 3 bindist, one which is a native compiler and library for the target
- - - - -
cdf04207 by Matthew Pickering at 2025-12-22T19:18:53+01:00
hadrian: Refactor system-cxx-std-lib rules0
I noticed a few things wrong with the hadrian rules for `system-cxx-std-lib` rules.
* For `text` there is an ad-hoc check to depend on `system-cxx-std-lib` outside of `configurePackage`.
* The `system-cxx-std-lib` dependency is not read from cabal files.
* Recache is not called on the packge database after the `.conf` file is generated, a more natural place for this rule is `registerRules`.
Treating this uniformly like other packages is complicated by it not having any source code or a cabal file. However we can do a bit better by reporting the dependency firstly in `PackageData` and then needing the `.conf` file in the same place as every other package in `configurePackage`.
Fixes #25303
- - - - -
2e690b9c by Sven Tennie at 2025-12-22T19:18:53+01:00
Increase timeout for emulators
Test runs with emulators naturally take longer than on native machines.
Generate jobs.yml
- - - - -
620b9aa1 by Sven Tennie at 2025-12-22T19:18:53+01:00
ghc: Distinguish between having an interpreter and having an internal one
Otherwise, we fail with warnings when compiling tools. Actually, these
are related but different things:
- ghc can run an interpreter (either internal or external)
- ghc is compiled with an internal interpreter
- - - - -
68 changed files:
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- configure.ac
- distrib/configure.ac.in
- ghc/GHC/Driver/Session/Mode.hs
- ghc/GHCi/UI.hs
- ghc/Main.hs
- ghc/ghc-bin.cabal.in
- hadrian/README.md
- hadrian/bindist/config.mk.in
- + hadrian/cfg/system.config.host.in
- hadrian/cfg/system.config.in
- + hadrian/cfg/system.config.target.in
- hadrian/hadrian.cabal
- hadrian/src/Base.hs
- + hadrian/src/BindistConfig.hs
- hadrian/src/Builder.hs
- hadrian/src/Context.hs
- hadrian/src/Expression.hs
- hadrian/src/Flavour.hs
- hadrian/src/Flavour/Type.hs
- hadrian/src/Hadrian/Builder.hs
- hadrian/src/Hadrian/Expression.hs
- hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
- hadrian/src/Hadrian/Haskell/Cabal/Type.hs
- hadrian/src/Hadrian/Haskell/Hash.hs
- hadrian/src/Hadrian/Oracles/TextFile.hs
- hadrian/src/Oracles/Flag.hs
- hadrian/src/Oracles/Flavour.hs
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Oracles/TestSettings.hs
- hadrian/src/Packages.hs
- hadrian/src/Rules.hs
- hadrian/src/Rules/BinaryDist.hs
- hadrian/src/Rules/CabalReinstall.hs
- hadrian/src/Rules/Compile.hs
- hadrian/src/Rules/Documentation.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Rules/Gmp.hs
- hadrian/src/Rules/Libffi.hs
- hadrian/src/Rules/Library.hs
- hadrian/src/Rules/Program.hs
- hadrian/src/Rules/Register.hs
- hadrian/src/Rules/Rts.hs
- hadrian/src/Rules/Test.hs
- hadrian/src/Settings.hs
- hadrian/src/Settings/Builders/Cabal.hs
- hadrian/src/Settings/Builders/Common.hs
- hadrian/src/Settings/Builders/Configure.hs
- hadrian/src/Settings/Builders/DeriveConstants.hs
- hadrian/src/Settings/Builders/Ghc.hs
- hadrian/src/Settings/Builders/Hsc2Hs.hs
- hadrian/src/Settings/Builders/RunTest.hs
- hadrian/src/Settings/Builders/SplitSections.hs
- hadrian/src/Settings/Default.hs
- hadrian/src/Settings/Flavours/Benchmark.hs
- hadrian/src/Settings/Flavours/Development.hs
- hadrian/src/Settings/Flavours/GhcInGhci.hs
- hadrian/src/Settings/Flavours/Performance.hs
- hadrian/src/Settings/Flavours/Quick.hs
- hadrian/src/Settings/Flavours/QuickCross.hs
- hadrian/src/Settings/Flavours/Quickest.hs
- hadrian/src/Settings/Flavours/Validate.hs
- hadrian/src/Settings/Packages.hs
- hadrian/src/Settings/Program.hs
- hadrian/src/Settings/Warnings.hs
- testsuite/ghc-config/ghc-config.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e34073d43c30c6a76ac6d39190ac33…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e34073d43c30c6a76ac6d39190ac33…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/T26681] 34 commits: base: generalize delete{Firsts,}By
by Simon Peyton Jones (@simonpj) 22 Dec '25
by Simon Peyton Jones (@simonpj) 22 Dec '25
22 Dec '25
Simon Peyton Jones pushed to branch wip/T26681 at Glasgow Haskell Compiler / GHC
Commits:
b230d549 by mangoiv at 2025-12-16T15:17:45-05:00
base: generalize delete{Firsts,}By
When we delete{Firsts,}By we should not require the
lists to be the same type. This is an especially useful
generalisation in the case of deleteFirstsBy because we
can skip an invocation of the map function.
This change was discussed on the core-libraries-committee's bug
tracker at https://github.com/haskell/core-libraries-committee/issues/372.
- - - - -
6a2b43e3 by Cheng Shao at 2025-12-16T15:18:30-05:00
compiler: clean up redundant LANGUAGE pragmas
This patch bumps `default-language` of `ghc`/`ghc-bin` from `GHC2021`
to `GHC2024` (which is supported in ghc 9.10, current boot ghc lower
version bound), and also cleans up redundant `LANGUAGE` pragmas (as
well as `default-extensions`/`other-extensions`) that are already
implied by `GHC2024`.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
fca9cd7c by sheaf at 2025-12-18T13:18:18-05:00
X86 CodeGen: fix assign_eax_sse_regs
We must set %al to the number of SSE2 registers that contain arguments
(in case we are dealing with a varargs function). The logic for counting
how many arguments reside in SSE2 registers was incorrect, as it used
'isFloatFormat', which incorrectly ignores vector registers.
We now instead do case analysis on the register class:
is_sse_reg r =
case targetClassOfReg platform r of
RcFloatOrVector -> True
RcInteger -> False
This change is necessary to prevent segfaults in T20030_test1j, because
subsequent commits change the format calculations, resulting in vector
formats more often.
- - - - -
53150617 by sheaf at 2025-12-18T13:18:19-05:00
X86 regUsageOfInstr: fix format for IMUL
When used with 8-bit operands, the IMUL instruction returns the result
in the lower 16 bits of %rax (also known as %ax). This is different
than for the other sizes, where an input at 16, 32 or 64 bits will
result in 16, 32 or 64 bits of output in both %rax and %rdx.
This doesn't affect the behaviour of the compiler, because we don't
allow partial writes at sub-word sizes. The rationale is explained
in Wrinkle [Don't allow scalar partial writes] in Note [Register formats in liveness analysis],
in GHC.CmmToAsm.Reg.Liveness.
- - - - -
c7a56dd1 by sheaf at 2025-12-18T13:18:19-05:00
Liveness analysis: consider register formats
This commit updates the register allocator to be a bit more careful in
situations in which a single register is used at multiple different
formats, e.g. when xmm1 is used both to store a Double# and a DoubleX2#.
This is done by introducing the 'Regs' newtype around 'UniqSet RegWithFormat',
for which the combining operations take the larger of the two formats
instead of overriding the format.
Operations on 'Regs' are defined in 'GHC.CmmToAsm.Reg.Regs'. There is
a modest compile-time cost for the additional overhead for tracking
register formats, which causes the metric increases of this commit.
The subtle aspects of the implementation are outlined in
Note [Register formats in liveness analysis] in GHC.CmmToAsm.Reg.Liveness.
Fixes #26411 #26611
-------------------------
Metric Increase:
T12707
T26425
T3294
-------------------------
- - - - -
c2e83339 by sheaf at 2025-12-18T13:18:19-05:00
Register allocator: reload at same format as spill
This commit ensures that if we spill a register onto the stack at a
given format, we then always reload the register at this same format.
This ensures we don't end up in a situation where we spill F64x2 but end
up only reloading the lower F64. This first reload would make us believe
the whole data is in a register, thus silently losing the upper 64 bits
of the spilled register's contents.
Fixes #26526
- - - - -
55ab583b by sheaf at 2025-12-18T13:18:19-05:00
Register allocation: writes redefine format
As explained in Note [Allocated register formats] in GHC.CmmToAsm.Reg.Linear,
we consider all writes to redefine the format of the register.
This ensures that in a situation such as
movsd .Ln6m(%rip),%v1
shufpd $0,%v1,%v1
we properly consider the broadcast operation to change the format of %v1
from F64 to F64x2.
This completes the fix to #26411 (test in T26411b).
- - - - -
951402ed by Vladislav Zavialov at 2025-12-18T13:19:05-05:00
Parser: improve mkModuleImpExp, remove checkImportSpec
1. The `mkModuleImpExp` helper now knows whether it is processing an import or
export list item, and uses this information to produce a more accurate error
message for `import M (T(..,x))` with PatternSynonyms disabled.
The old message incorrectly referred to this case as an export form.
2. The `checkImportSpec` helper is removed in favor of more comprehensive error
checking in `mkModuleImpExp`.
3. Additionaly, the invariants of `ImpExpList` and `ImpExpAllWith` have been
made more explicit in the comments and assertions (calls to 'panic').
Test case: import-syntax-no-ext
- - - - -
47d83d96 by Vladislav Zavialov at 2025-12-18T13:19:06-05:00
Subordinate namespace-specified wildcards (#25901)
Add support for subordinate namespace-specified wildcards
`X(type ..)` and `X(data ..)` to import and export lists.
Examples:
import M (Cls(type ..)) -- imports Cls and all its associated types
import M (Cls(data ..)) -- imports Cls and all its methods
module M (R(data ..), C(type ..)) where
-- exports R and all its data constructors and record fields;
-- exports C and all its associated types, but not its methods
The scope of this change is limited to the case where the wildcard is the only
subordinate import/export item, whereas the more complex forms `X(type .., f)`
or `X(type .., data ..)` are unsupported and raise the newly introduced
PsErrUnsupportedExplicitNamespace error. This restriction may be lifted later.
Summary of the changes:
1. Refactor IEThingAll to store its extension field XIEThingAll as a record
IEThingAllExt instead of a tuple.
2. Extend the AST by adding a NamespaceSpecifier field to IEThingAllExt,
representing an optional namespace specifier `type` or `data` in front
of a subordinate wildcard `X(..)`.
3. Extend the grammar in Parser.y with productions for `type ..` and `data ..`
in subordinate import/export items.
4. Introduce `filterByNamespaceGREs` to filter [GlobalRdrElt] by a
NamespaceSpecifier; use it in `filterImports` and `exports_from_avail`
to account for the namespace specifier in IEThingAll.
5. Improve diagnostics by storing more information in DodgyImportsEmptyParent
and DodgyExportsEmptyParent.
Test cases:
T25901_sub_e T25901_sub_f T25901_sub_g T25901_sub_a
T25901_sub_b T25901_sub_c T25901_sub_d T25901_sub_w
DodgyImports02 DodgyImports03 DodgyImports04
- - - - -
eac418bb by Recursion Ninja at 2025-12-18T13:19:48-05:00
Removing the 'Data' instance for 'InstEnv'.
The 'Data' instance is blocking work on Trees that Grow, and the
'Data' instance seem to have been added without a clear purpose.
- - - - -
e920e038 by Recursion Ninja at 2025-12-18T13:19:48-05:00
'Decouple Language.Haskell.Syntax.Decls' from 'GHC.Unit.Module.Warnings'
- - - - -
bd38b76c by Cheng Shao at 2025-12-18T13:20:31-05:00
testsuite: improve coverage of foundation test
This patch refactors the `foundation` test a bit to improve coverage:
- Instead of using a hard-coded seed, a random seed is now taken from
the command line, and printed upon test failure. This improves test
coverage over many future CI runs, and shall a failure occur, the
seed is available in the CI log for local reproduction.
- The iterations count is bumped to 1000 instead of 100, similar to
the bump in `test-primops`. Runtime timeout is bumped 2x just to be
safe.
- Improve `newLCGGen` by using non-atomic loads/stores on a
`MutableByteArray#` for storing mutable `Word64`, this test doesn't
use parallelism in the first place
- Fixed a few compiler warnings and removed redundant pragmas and
imports
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
3995187c by Sylvain Henry at 2025-12-18T13:21:45-05:00
Doc: document -pgmi "" (#26634)
- - - - -
5729418c by Cheng Shao at 2025-12-18T13:22:29-05:00
rts: use __builtin_mul_overflow for hs_mulIntMayOflo
This patch uses `__builtin_mul_overflow` to implement
`hs_mulIntMayOflo`. This is a GNU C checked arithmetic builtin
function supported by gcc/clang, is type-generic so works for both
32-bit/64-bit, and makes the code both more efficient and easier to
read/maintain than the previous hand rolled logic.
- - - - -
1ca4b49a by Cheng Shao at 2025-12-18T13:23:11-05:00
compiler/rts: fix ABI mismatch in barf() invocations
This patch fixes a long-standing issue of ABI mismatch in `barf()`
invocations, both in compiler-emitted code and in hand written Cmm
code:
- In RTS, we have `barf()` which reports a fatal internal error
message and exits the program.
- `barf()` is a variadic C function! When used as a callee of a
foreign call with `ccall` calling convention instead of `capi`,
there is an ABI mismatch between the caller and the callee!
- Unfortunately, both the compiler and the Cmm sources contain many
places where we call `barf()` via `ccall` convention!! Like, when
you write `foreign "C" barf("foo object (%p) entered!", R1)`, it
totally doesn't do what you think it'll do at all!! The second
argument `R1` is not properly passed in `va_list`, and the behavior
is completely undefined!!
- Even more unfortunately, this issue has been sitting around long
enough because the ABI mismatch is subtle enough on normie platforms
like x64 and arm64.
- But there are platforms like wasm32 that are stricter about ABI, and
the broken `barf()` invocations already causes trouble for wasm
backend: we had to use ugly hacks like `barf(errmsg, NULL)` to make
`wasm-ld` happy, and even with this band-aid, compiler-generated
`barf()` invocations are still broken, resulting in regressions in
certain debug-related functionality, e.g. `-dtag-inference-checks`
is broken on wasm32 (#22882).
This patch properly fixes the issue:
- We add non-variadic `barf` wrappers in the RTS that can be used as
`ccall` callees
- Both the compiler `emitBarf` logic and the hand-written Cmm are
changed to call these wrappers
- `emitBarf` now also properly annotates the foreign call as
`CmmNeverReturns` to indicate it's a noreturn call to enable more
efficient code generation
`-dtag-inference-checks` now works on wasm. Closes #22882.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
b3dd23b9 by Vilim Lendvaj at 2025-12-18T13:23:57-05:00
Remove outdated comment
The Traversable instance for ZipList is no longer in
GHC.Internal.Data.Traversable. In fact, it is right below this very comment.
- - - - -
9a9c2f03 by Cheng Shao at 2025-12-18T13:24:39-05:00
compiler: remove unused OtherSection logic
This patch removes the OtherSection logic in Cmm, given it's never
actually used by any of our backends.
- - - - -
91edd292 by Wolfgang Jeltsch at 2025-12-19T03:18:19-05:00
Remove unused known-key and name variables for generics
This removes the known-key and corresponding name variables for `K1`,
`M1`, `R`, `D`, `C`, `S`, and `URec` from `GHC.Generics`, as they are
apparently nowhere used in GHC’s source code.
- - - - -
73ee7e38 by Wolfgang Jeltsch at 2025-12-19T03:19:02-05:00
Remove unused known keys and names for generics classes
This removes the known-key and corresponding name variables for
`Datatype`, `Constructor`, and `Selector` from `GHC.Generics`, as they
are apparently nowhere used in GHC’s source code.
- - - - -
f69c5f14 by Cheng Shao at 2025-12-19T03:19:45-05:00
wasm: fix handling of ByteArray#/MutableByteArray# arguments in JSFFI imports
This patch fixes the handling of ByteArray#/MutableByteArray#
arguments in JSFFI imports, see the amended note and manual for
explanation. Also adds a test to witness the fix.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
224446a2 by Cheng Shao at 2025-12-20T07:49:54-05:00
rts: workaround -Werror=maybe-uninitialized false positives
In some cases gcc might report -Werror=maybe-uninitialized that we
know are false positives, but need to workaround it to make validate
builds with -Werror pass.
- - - - -
251ec087 by Cheng Shao at 2025-12-20T07:49:54-05:00
hadrian: use -Og as C/C++ optimization level when debugging
This commit enables -Og as optimization level when compiling the debug
ways of rts. According to gcc documentation
(https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-Og)
-Og is a better choice than -O0 for producing debuggable code. It's
also supported by clang as well, so it makes sense to use it as a
default for debugging. Also add missing -g3 flag to C++ compilation
flags in +debug_info flavour transformer.
- - - - -
fb586c67 by Cheng Shao at 2025-12-20T07:50:36-05:00
compiler: replace DList with OrdList
This patch removes `DList` logic from the compiler and replaces it
with `OrdList` which also supports O(1) concatenation and should be
more memory efficient than the church-encoded `DList`.
- - - - -
8149c987 by Cheng Shao at 2025-12-20T17:06:51-05:00
hadrian: add with_profiled_libs flavour transformer
This patch adds a `with_profiled_libs` flavour transformer to hadrian
which is the exact opposite of `no_profiled_libs`. It adds profiling
ways to stage1+ rts/library ways, and doesn't alter other flavour
settings. It is useful when needing to test profiling logic locally
with a quick flavour.
- - - - -
746b18cd by Cheng Shao at 2025-12-20T17:06:51-05:00
hadrian: fix missing profiled dynamic libraries in profiled_ghc
This commit fixes the profiled_ghc flavour transformer to include
profiled dynamic libraries as well, since they're supported by GHC
since !12595.
- - - - -
4dd7e3b9 by Cheng Shao at 2025-12-20T17:07:33-05:00
ci: set http.postBuffer to mitigate perf notes timeout on some runners
This patch sets http.postBuffer to mitigate the timeout when fetching
perf notes on some runners with slow internet connection. Fixes #26684.
- - - - -
bc36268a by Wolfgang Jeltsch at 2025-12-21T16:23:24-05:00
Remove unused known keys and names for type representations
This removes the known-key and corresponding name variables for
`TrName`, `TrNameD`, `TypeRep`, `KindRepTypeLitD`, `TypeLitSort`, and
`mkTrType`, as they are apparently nowhere used in GHC’s source code.
- - - - -
ff5050e9 by Wolfgang Jeltsch at 2025-12-21T16:24:04-05:00
Remove unused known keys and names for natural operations
This removes the known-key and corresponding name variables for
`naturalAndNot`, `naturalLog2`, `naturalLogBaseWord`, `naturalLogBase`,
`naturalPowMod`, `naturalSizeInBase`, `naturalToFloat`, and
`naturalToDouble`, as they are apparently nowhere used in GHC’s source
code.
- - - - -
424388c2 by Wolfgang Jeltsch at 2025-12-21T16:24:45-05:00
Remove the unused known key and name for `Fingerprint`
This removes the variables for the known key and the name of the
`Fingerprint` data constructor, as they are apparently nowhere used in
GHC’s source code.
- - - - -
a1ed86fe by Wolfgang Jeltsch at 2025-12-21T16:25:26-05:00
Remove the unused known key and name for `failIO`
This removes the variables for the known key and the name of the
`failIO` operation, as they are apparently nowhere used in GHC’s source
code.
- - - - -
b8220daf by Wolfgang Jeltsch at 2025-12-21T16:26:07-05:00
Remove the unused known key and name for `liftM`
This removes the variables for the known key and the name of the `liftM`
operation, as they are apparently nowhere used in GHC’s source code.
- - - - -
eb0628b1 by Wolfgang Jeltsch at 2025-12-21T16:26:47-05:00
Fix the documentation of `hIsClosed`
- - - - -
806a903f by Simon Peyton Jones at 2025-12-22T17:34:16+00:00
Add missing InVar->OutVar lookup in SetLevels
As #26681 showed, the SetLevels pass was failing to map an InVar to
an OutVar. Very silly! I'm amazed it hasn't broken before now.
I have improved the type singatures (to mention InVar and OutVar)
so it's more obvious what needs to happen.
- - - - -
cce45764 by Simon Peyton Jones at 2025-12-22T17:34:16+00:00
Wibbles to perf
- - - - -
540 changed files:
- .gitlab/ci.sh
- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Builtin/PrimOps/Ids.hs
- compiler/GHC/Builtin/Types/Literals.hs
- compiler/GHC/Builtin/Utils.hs
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Breakpoints.hs
- compiler/GHC/ByteCode/InfoTable.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/ByteCode/Linker.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Cmm.hs
- compiler/GHC/Cmm/BlockId.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/CommonBlockElim.hs
- compiler/GHC/Cmm/Config.hs
- compiler/GHC/Cmm/ContFlowOpt.hs
- compiler/GHC/Cmm/Dataflow.hs
- compiler/GHC/Cmm/Dataflow/Block.hs
- compiler/GHC/Cmm/Dataflow/Graph.hs
- compiler/GHC/Cmm/Dataflow/Label.hs
- compiler/GHC/Cmm/DebugBlock.hs
- compiler/GHC/Cmm/Dominators.hs
- compiler/GHC/Cmm/Expr.hs
- compiler/GHC/Cmm/Graph.hs
- compiler/GHC/Cmm/Info/Build.hs
- compiler/GHC/Cmm/LRegSet.hs
- compiler/GHC/Cmm/LayoutStack.hs
- compiler/GHC/Cmm/Lint.hs
- compiler/GHC/Cmm/Liveness.hs
- compiler/GHC/Cmm/MachOp.hs
- compiler/GHC/Cmm/Node.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/ProcPoint.hs
- compiler/GHC/Cmm/Reducibility.hs
- compiler/GHC/Cmm/Reg.hs
- compiler/GHC/Cmm/Sink.hs
- compiler/GHC/Cmm/Switch.hs
- compiler/GHC/Cmm/Switch/Implement.hs
- compiler/GHC/Cmm/ThreadSanitizer.hs
- compiler/GHC/Cmm/UniqueRenamer.hs
- compiler/GHC/Cmm/Utils.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/BlockLayout.hs
- compiler/GHC/CmmToAsm/CFG.hs
- compiler/GHC/CmmToAsm/CPrim.hs
- compiler/GHC/CmmToAsm/Dwarf/Types.hs
- compiler/GHC/CmmToAsm/Format.hs
- compiler/GHC/CmmToAsm/LA64/CodeGen.hs
- compiler/GHC/CmmToAsm/LA64/Ppr.hs
- compiler/GHC/CmmToAsm/Monad.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/PPC/Ppr.hs
- compiler/GHC/CmmToAsm/Ppr.hs
- compiler/GHC/CmmToAsm/RV64/CodeGen.hs
- compiler/GHC/CmmToAsm/RV64/Ppr.hs
- compiler/GHC/CmmToAsm/Reg/Graph.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Coalesce.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs
- compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs
- compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs
- compiler/GHC/CmmToAsm/Reg/Linear.hs
- compiler/GHC/CmmToAsm/Reg/Linear/Base.hs
- compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs
- compiler/GHC/CmmToAsm/Reg/Linear/State.hs
- compiler/GHC/CmmToAsm/Reg/Linear/X86.hs
- compiler/GHC/CmmToAsm/Reg/Linear/X86_64.hs
- compiler/GHC/CmmToAsm/Reg/Liveness.hs
- + compiler/GHC/CmmToAsm/Reg/Regs.hs
- compiler/GHC/CmmToAsm/Reg/Target.hs
- compiler/GHC/CmmToAsm/Wasm.hs
- compiler/GHC/CmmToAsm/Wasm/Asm.hs
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- compiler/GHC/CmmToAsm/Wasm/Types.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/CmmToLlvm/Base.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/CmmToLlvm/Data.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Coercion.hs-boot
- compiler/GHC/Core/Coercion/Axiom.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/FamInstEnv.hs
- compiler/GHC/Core/InstEnv.hs
- compiler/GHC/Core/LateCC/OverloadedCalls.hs
- compiler/GHC/Core/LateCC/TopLevelBinds.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Lint/Interactive.hs
- compiler/GHC/Core/Map/Expr.hs
- compiler/GHC/Core/Map/Type.hs
- compiler/GHC/Core/Opt/CallerCC.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Core/Opt/Monad.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Ppr.hs
- compiler/GHC/Core/Predicate.hs
- compiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/Core/TyCo/Compare.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/TyCon/Env.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Type.hs-boot
- compiler/GHC/Core/Unify.hs
- compiler/GHC/CoreToStg.hs
- compiler/GHC/Data/Bag.hs
- compiler/GHC/Data/FastString.hs
- compiler/GHC/Data/Graph/Collapse.hs
- compiler/GHC/Data/Graph/Color.hs
- compiler/GHC/Data/Graph/Directed.hs
- compiler/GHC/Data/List/Infinite.hs
- compiler/GHC/Data/List/NonEmpty.hs
- compiler/GHC/Data/Maybe.hs
- compiler/GHC/Data/Pair.hs
- compiler/GHC/Data/Stream.hs
- compiler/GHC/Data/Strict.hs
- compiler/GHC/Data/StringBuffer.hs
- compiler/GHC/Data/TrieMap.hs
- compiler/GHC/Data/Word64Map.hs
- compiler/GHC/Driver/Backend.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/CmdLine.hs
- compiler/GHC/Driver/CodeOutput.hs
- compiler/GHC/Driver/Config/StgToCmm.hs
- compiler/GHC/Driver/Config/Tidy.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Env/KnotVars.hs
- compiler/GHC/Driver/Errors.hs
- compiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/Driver/Errors/Types.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/GenerateCgIPEStub.hs
- compiler/GHC/Driver/Hooks.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/MakeSem.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Pipeline/LogQueue.hs
- compiler/GHC/Driver/Pipeline/Monad.hs
- compiler/GHC/Driver/Pipeline/Phases.hs
- compiler/GHC/Driver/Plugins.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Driver/Session/Inspect.hs
- compiler/GHC/Driver/Session/Units.hs
- compiler/GHC/Hs.hs
- compiler/GHC/Hs/Basic.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Doc.hs
- compiler/GHC/Hs/Doc.hs-boot
- compiler/GHC/Hs/DocString.hs
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Expr.hs-boot
- compiler/GHC/Hs/Extension.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Lit.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Pat.hs-boot
- compiler/GHC/Hs/Stats.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Foreign/Decl.hs
- compiler/GHC/HsToCore/Foreign/Wasm.hs
- compiler/GHC/HsToCore/ListComp.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Match/Literal.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Pmc/Check.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Pmc/Solver.hs
- compiler/GHC/HsToCore/Pmc/Solver/Types.hs
- compiler/GHC/HsToCore/Pmc/Types.hs
- compiler/GHC/HsToCore/Pmc/Utils.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Utils.hs
- compiler/GHC/Iface/Binary.hs
- compiler/GHC/Iface/Decl.hs
- compiler/GHC/Iface/Env.hs
- compiler/GHC/Iface/Errors.hs
- compiler/GHC/Iface/Errors/Ppr.hs
- compiler/GHC/Iface/Errors/Types.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Ext/Debug.hs
- compiler/GHC/Iface/Ext/Types.hs
- compiler/GHC/Iface/Ext/Utils.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Iface/Rename.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/Iface/Type.hs
- compiler/GHC/Iface/Warnings.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/JS/Ident.hs
- compiler/GHC/JS/JStg/Monad.hs
- compiler/GHC/JS/JStg/Syntax.hs
- compiler/GHC/JS/Make.hs
- compiler/GHC/JS/Optimizer.hs
- compiler/GHC/JS/Ppr.hs
- compiler/GHC/JS/Syntax.hs
- compiler/GHC/JS/Transform.hs
- compiler/GHC/Linker/Deps.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Linker/Types.hs
- compiler/GHC/Llvm/MetaData.hs
- compiler/GHC/Llvm/Ppr.hs
- compiler/GHC/Llvm/Types.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/Errors/Basic.hs
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Parser/String.hs
- compiler/GHC/Parser/Types.hs
- compiler/GHC/Platform.hs
- compiler/GHC/Platform/Reg/Class.hs
- compiler/GHC/Platform/Reg/Class/NoVectors.hs
- compiler/GHC/Platform/Reg/Class/Separate.hs
- compiler/GHC/Platform/Reg/Class/Unified.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Expr.hs-boot
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Rename/Unbound.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Runtime/Heap/Layout.hs
- compiler/GHC/Runtime/Interpreter.hs
- compiler/GHC/Runtime/Interpreter/JS.hs
- compiler/GHC/Runtime/Interpreter/Process.hs
- compiler/GHC/Runtime/Interpreter/Types.hs
- compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs
- compiler/GHC/Settings/IO.hs
- compiler/GHC/Stg/Debug.hs
- compiler/GHC/Stg/EnforceEpt.hs
- compiler/GHC/Stg/EnforceEpt/Rewrite.hs
- compiler/GHC/Stg/EnforceEpt/TagSig.hs
- compiler/GHC/Stg/EnforceEpt/Types.hs
- compiler/GHC/Stg/FVs.hs
- compiler/GHC/Stg/Lift/Analysis.hs
- compiler/GHC/Stg/Lift/Monad.hs
- compiler/GHC/Stg/Lift/Types.hs
- compiler/GHC/Stg/Lint.hs
- compiler/GHC/Stg/Pipeline.hs
- compiler/GHC/Stg/Syntax.hs
- compiler/GHC/Stg/Unarise.hs
- compiler/GHC/Stg/Utils.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToCmm.hs
- compiler/GHC/StgToCmm/ArgRep.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/CgUtils.hs
- compiler/GHC/StgToCmm/Closure.hs
- compiler/GHC/StgToCmm/ExtCode.hs
- compiler/GHC/StgToCmm/InfoTableProv.hs
- compiler/GHC/StgToCmm/Lit.hs
- compiler/GHC/StgToCmm/Monad.hs
- compiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/StgToCmm/Utils.hs
- compiler/GHC/StgToJS/Apply.hs
- compiler/GHC/StgToJS/Arg.hs
- compiler/GHC/StgToJS/CodeGen.hs
- compiler/GHC/StgToJS/DataCon.hs
- compiler/GHC/StgToJS/Deps.hs
- compiler/GHC/StgToJS/Expr.hs
- compiler/GHC/StgToJS/ExprCtx.hs
- compiler/GHC/StgToJS/FFI.hs
- compiler/GHC/StgToJS/Heap.hs
- compiler/GHC/StgToJS/Linker/Linker.hs
- compiler/GHC/StgToJS/Linker/Opt.hs
- compiler/GHC/StgToJS/Linker/Types.hs
- compiler/GHC/StgToJS/Literal.hs
- compiler/GHC/StgToJS/Monad.hs
- compiler/GHC/StgToJS/Object.hs
- compiler/GHC/StgToJS/Rts/Rts.hs
- compiler/GHC/StgToJS/Rts/Types.hs
- compiler/GHC/StgToJS/Sinker/Collect.hs
- compiler/GHC/StgToJS/Sinker/Sinker.hs
- compiler/GHC/StgToJS/Sinker/StringsUnfloat.hs
- compiler/GHC/StgToJS/Types.hs
- compiler/GHC/StgToJS/Utils.hs
- compiler/GHC/SysTools.hs
- compiler/GHC/SysTools/Ar.hs
- compiler/GHC/SysTools/BaseDir.hs
- compiler/GHC/SysTools/Cpp.hs
- compiler/GHC/SysTools/Tasks.hs
- compiler/GHC/SysTools/Terminal.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Deriv/Functor.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Deriv/Generics.hs
- compiler/GHC/Tc/Deriv/Utils.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Hole.hs
- compiler/GHC/Tc/Errors/Hole/FitTypes.hs
- compiler/GHC/Tc/Errors/Hole/Plugin.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Errors/Types/PromotionErr.hs
- compiler/GHC/Tc/Gen/Annotation.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Arrow.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Default.hs
- compiler/GHC/Tc/Gen/Do.hs
- compiler/GHC/Tc/Gen/Export.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Foreign.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Instance/Family.hs
- compiler/GHC/Tc/Instance/FunDeps.hs
- compiler/GHC/Tc/Instance/Typeable.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Irred.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Types.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/TyCl/Utils.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/ErrCtxt.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Backpack.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/Instantiate.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Tc/Validity.hs
- compiler/GHC/Tc/Zonk/Monad.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Annotations.hs
- compiler/GHC/Types/Avail.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/CompleteMatch.hs
- compiler/GHC/Types/CostCentre.hs
- compiler/GHC/Types/CostCentre/State.hs
- compiler/GHC/Types/DefaultEnv.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Error.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/FieldLabel.hs
- compiler/GHC/Types/Fixity.hs
- compiler/GHC/Types/ForeignCall.hs
- compiler/GHC/Types/ForeignStubs.hs
- compiler/GHC/Types/GREInfo.hs
- compiler/GHC/Types/Hint.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/GHC/Types/Id/Info.hs
- compiler/GHC/Types/Id/Make.hs
- compiler/GHC/Types/Literal.hs
- compiler/GHC/Types/Name.hs
- compiler/GHC/Types/Name/Cache.hs
- compiler/GHC/Types/Name/Occurrence.hs
- compiler/GHC/Types/Name/Reader.hs
- compiler/GHC/Types/Name/Set.hs
- compiler/GHC/Types/PkgQual.hs
- compiler/GHC/Types/RepType.hs
- compiler/GHC/Types/SaneDouble.hs
- compiler/GHC/Types/SourceText.hs
- compiler/GHC/Types/SrcLoc.hs
- compiler/GHC/Types/Tickish.hs
- compiler/GHC/Types/TyThing.hs
- compiler/GHC/Types/Unique/DFM.hs
- compiler/GHC/Types/Unique/DSet.hs
- compiler/GHC/Types/Unique/FM.hs
- compiler/GHC/Types/Unique/Map.hs
- compiler/GHC/Types/Unique/SDFM.hs
- compiler/GHC/Types/Unique/Set.hs
- compiler/GHC/Types/Var.hs
- compiler/GHC/Unit.hs
- compiler/GHC/Unit/Env.hs
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Unit/Home/PackageTable.hs
- compiler/GHC/Unit/Info.hs
- compiler/GHC/Unit/Module.hs
- compiler/GHC/Unit/Module/Deps.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Unit/Module/ModIface.hs
- compiler/GHC/Unit/Module/ModSummary.hs
- compiler/GHC/Unit/Module/Status.hs
- compiler/GHC/Unit/Module/Warnings.hs
- compiler/GHC/Unit/Module/WholeCoreBindings.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Unit/Types.hs-boot
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Binary/Typeable.hs
- compiler/GHC/Utils/Exception.hs
- compiler/GHC/Utils/Json.hs
- compiler/GHC/Utils/Logger.hs
- compiler/GHC/Utils/Misc.hs
- compiler/GHC/Utils/Monad/Codensity.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/GHC/Utils/Panic.hs
- compiler/GHC/Utils/Panic/Plain.hs
- compiler/GHC/Wasm/ControlFlow.hs
- compiler/GHC/Wasm/ControlFlow/FromCmm.hs
- compiler/Language/Haskell/Syntax.hs
- compiler/Language/Haskell/Syntax/Basic.hs
- compiler/Language/Haskell/Syntax/Binds.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/Expr.hs-boot
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- compiler/Language/Haskell/Syntax/Lit.hs
- compiler/Language/Haskell/Syntax/Pat.hs
- compiler/Language/Haskell/Syntax/Pat.hs-boot
- compiler/Language/Haskell/Syntax/Type.hs
- compiler/ghc.cabal.in
- docs/users_guide/phases.rst
- docs/users_guide/wasm.rst
- ghc/GHC/Driver/Session/Lint.hs
- ghc/GHC/Driver/Session/Mode.hs
- ghc/GHCi/Leak.hs
- ghc/GHCi/UI.hs
- ghc/GHCi/UI/Exception.hs
- ghc/GHCi/UI/Info.hs
- ghc/GHCi/UI/Monad.hs
- ghc/Main.hs
- ghc/ghc-bin.cabal.in
- hadrian/doc/flavours.md
- hadrian/src/Flavour.hs
- hadrian/src/Settings/Packages.hs
- libraries/base/changelog.md
- libraries/ghc-internal/src/GHC/Internal/Data/OldList.hs
- libraries/ghc-internal/src/GHC/Internal/Functor/ZipList.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle.hs
- rts/Apply.cmm
- rts/Compact.cmm
- rts/ContinuationOps.cmm
- rts/Exception.cmm
- rts/Jumps.h
- rts/PrimOps.cmm
- rts/RtsMessages.c
- rts/StgMiscClosures.cmm
- rts/StgStartup.cmm
- rts/include/Stg.h
- rts/include/rts/Messages.h
- rts/linker/InitFini.c
- rts/prim/mulIntMayOflo.c
- rts/sm/Sanity.c
- testsuite/tests/diagnostic-codes/codes.stdout
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/jsffi/all.T
- + testsuite/tests/jsffi/bytearrayarg.hs
- + testsuite/tests/jsffi/bytearrayarg.mjs
- + testsuite/tests/jsffi/bytearrayarg.stdout
- testsuite/tests/numeric/should_run/all.T
- testsuite/tests/numeric/should_run/foundation.hs
- testsuite/tests/numeric/should_run/foundation.stdout
- testsuite/tests/patsyn/should_fail/all.T
- + testsuite/tests/patsyn/should_fail/import-syntax-no-ext.hs
- + testsuite/tests/patsyn/should_fail/import-syntax-no-ext.stderr
- testsuite/tests/perf/should_run/all.T
- + testsuite/tests/rename/should_compile/T25901_sub_e.hs
- + testsuite/tests/rename/should_compile/T25901_sub_f.hs
- + testsuite/tests/rename/should_compile/T25901_sub_f.stderr
- + testsuite/tests/rename/should_compile/T25901_sub_g.hs
- + testsuite/tests/rename/should_compile/T25901_sub_g.stderr
- + testsuite/tests/rename/should_compile/T25901_sub_g_helper.hs
- testsuite/tests/rename/should_compile/all.T
- testsuite/tests/rename/should_fail/T23570b.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_a.hs
- + testsuite/tests/rename/should_fail/T25901_sub_a.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_b.hs
- + testsuite/tests/rename/should_fail/T25901_sub_b.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_c.hs
- + testsuite/tests/rename/should_fail/T25901_sub_c.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_c_helper.hs
- + testsuite/tests/rename/should_fail/T25901_sub_d.hs
- + testsuite/tests/rename/should_fail/T25901_sub_d.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_d_helper.hs
- + testsuite/tests/rename/should_fail/T25901_sub_w.hs
- + testsuite/tests/rename/should_fail/T25901_sub_w.stderr
- testsuite/tests/rename/should_fail/all.T
- + testsuite/tests/simd/should_run/T26411.hs
- + testsuite/tests/simd/should_run/T26411.stdout
- + testsuite/tests/simd/should_run/T26411b.hs
- + testsuite/tests/simd/should_run/T26411b.stdout
- testsuite/tests/simd/should_run/all.T
- + testsuite/tests/simplCore/should_compile/T26681.hs
- testsuite/tests/simplCore/should_compile/all.T
- testsuite/tests/simplStg/should_compile/all.T
- testsuite/tests/warnings/should_compile/DodgyExports03.stderr
- testsuite/tests/warnings/should_compile/DodgyImports.stderr
- + testsuite/tests/warnings/should_compile/DodgyImports02.hs
- + testsuite/tests/warnings/should_compile/DodgyImports02.stderr
- + testsuite/tests/warnings/should_compile/DodgyImports03.hs
- + testsuite/tests/warnings/should_compile/DodgyImports03.stderr
- + testsuite/tests/warnings/should_compile/DodgyImports03_helper.hs
- + testsuite/tests/warnings/should_compile/DodgyImports04.hs
- + testsuite/tests/warnings/should_compile/DodgyImports04.stderr
- testsuite/tests/warnings/should_compile/DodgyImports_hiding.stderr
- testsuite/tests/warnings/should_compile/all.T
- utils/check-exact/ExactPrint.hs
- utils/genapply/Main.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/459bd467af024a2570e5d3ac6ca532…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/459bd467af024a2570e5d3ac6ca532…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/shrink-block-free] rts: opportunistically reclaim slop space in shrinkMutableByteArray#
by Cheng Shao (@TerrorJack) 22 Dec '25
by Cheng Shao (@TerrorJack) 22 Dec '25
22 Dec '25
Cheng Shao pushed to branch wip/shrink-block-free at Glasgow Haskell Compiler / GHC
Commits:
1c1e01c1 by Cheng Shao at 2025-12-22T18:33:38+01:00
rts: opportunistically reclaim slop space in shrinkMutableByteArray#
Previously, `shrinkMutableByteArray#` shrinks a `MutableByteArray#`
in-place by assigning the new size to it, and zeroing the extra slop
space. That slop space is not reclaimed and wasted. But it's often the
case that we allocate a `MutableByteArray#` upfront, then shrink it
shortly after, so the `MutableByteArray#` closure sits right at the
end of a nursery block; this patch identifies such chances, and also
shrink `bd->free` if possible, reducing heap space fragmentation.
Co-authored-by: Codex <codex(a)openai.com>
-------------------------
Metric Decrease:
T10678
-------------------------
- - - - -
2 changed files:
- rts/PrimOps.cmm
- utils/deriveConstants/Main.hs
Changes:
=====================================
rts/PrimOps.cmm
=====================================
@@ -204,12 +204,47 @@ stg_isMutableByteArrayWeaklyPinnedzh ( gcptr mba )
stg_shrinkMutableByteArrayzh ( gcptr mba, W_ new_size )
// MutableByteArray# s -> Int# -> State# s -> State# s
{
- ASSERT(new_size <= StgArrBytes_bytes(mba));
+ W_ old_size, old_wds, new_wds;
+ W_ bd;
+
+ old_size = StgArrBytes_bytes(mba);
+ ASSERT(new_size <= old_size);
+ old_wds = BYTES_TO_WDS(SIZEOF_StgArrBytes) + ROUNDUP_BYTES_TO_WDS(old_size);
+ new_wds = BYTES_TO_WDS(SIZEOF_StgArrBytes) + ROUNDUP_BYTES_TO_WDS(new_size);
+
+ // Try to shrink bd->free as well, to reclaim slop space at the end
+ // of current block and avoid unnecessary fragmentation. But we
+ // must guarantee that:
+ //
+ // 1. mba is already at the end of current block (check bd->free).
+ // Otherwise we can't move closures that come after it anyway.
+ // 2. It's a nursery block that belongs to the current Capability,
+ // so check rCurrentAlloc (used by allocateMightFail) or
+ // pinned_object_block (used by allocatePinned). There's also no
+ // point if it's an older generation block, the mutator won't
+ // allocate into those blocks anyway.
+ //
+ // If check fails, fall back to the conservative code path: just
+ // zero the slop and return.
+ bd = Bdescr(mba);
+ if (bdescr_free(bd) != mba + WDS(old_wds) ||
+ (bd != StgRegTable_rCurrentAlloc(BaseReg) && bd != Capability_pinned_object_block(MyCapability()))) {
+ OVERWRITING_CLOSURE_MUTABLE(mba, new_wds);
+ StgArrBytes_bytes(mba) = new_size;
+ // No need to call PROF_HEADER_CREATE. See Note [LDV profiling and resizing arrays]
+ return ();
+ }
- OVERWRITING_CLOSURE_MUTABLE(mba, (BYTES_TO_WDS(SIZEOF_StgArrBytes) +
- ROUNDUP_BYTES_TO_WDS(new_size)));
+ // Check passes, we can shrink bd->free! Also uninitialize the slop
+ // if zero_on_gc is enabled, to conform with debug RTS convention.
StgArrBytes_bytes(mba) = new_size;
- // No need to call PROF_HEADER_CREATE. See Note [LDV profiling and resizing arrays]
+ IF_DEBUG(zero_on_gc,
+ prim %memset(mba + WDS(new_wds),
+ 0xaa,
+ WDS(old_wds - new_wds),
+ 1);
+ );
+ bdescr_free(bd) = mba + WDS(new_wds);
return ();
}
@@ -223,18 +258,10 @@ stg_shrinkMutableByteArrayzh ( gcptr mba, W_ new_size )
stg_resizzeMutableByteArrayzh ( gcptr mba, W_ new_size )
// MutableByteArray# s -> Int# -> State# s -> (# State# s,MutableByteArray# s #)
{
- W_ new_size_wds;
-
- ASSERT(new_size >= 0);
-
- new_size_wds = ROUNDUP_BYTES_TO_WDS(new_size);
-
- if (new_size_wds <= BYTE_ARR_WDS(mba)) {
- OVERWRITING_CLOSURE_MUTABLE(mba, (BYTES_TO_WDS(SIZEOF_StgArrBytes) +
- new_size_wds));
- StgArrBytes_bytes(mba) = new_size;
- // No need to call PROF_HEADER_CREATE. See Note [LDV profiling and resizing arrays]
+ ASSERT(new_size `ge` 0);
+ if (new_size <= StgArrBytes_bytes(mba)) {
+ call stg_shrinkMutableByteArrayzh(mba, new_size);
return (mba);
} else {
(P_ new_mba) = call stg_newByteArrayzh(new_size);
=====================================
utils/deriveConstants/Main.hs
=====================================
@@ -395,6 +395,7 @@ wanteds os = concat
,fieldOffset Both "StgRegTable" "rCurrentTSO"
,fieldOffset Both "StgRegTable" "rCurrentNursery"
,fieldOffset Both "StgRegTable" "rHpAlloc"
+ ,structField C "StgRegTable" "rCurrentAlloc"
,structField C "StgRegTable" "rRet"
,structField C "StgRegTable" "rNursery"
@@ -414,6 +415,7 @@ wanteds os = concat
,structField C "Capability" "weak_ptr_list_hd"
,structField C "Capability" "weak_ptr_list_tl"
,structField C "Capability" "n_run_queue"
+ ,structField C "Capability" "pinned_object_block"
,structField Both "bdescr" "start"
,structField Both "bdescr" "free"
@@ -629,6 +631,8 @@ wanteds os = concat
"RTS_FLAGS" "DebugFlags.sanity"
,structField_ C "RtsFlags_DebugFlags_weak"
"RTS_FLAGS" "DebugFlags.weak"
+ ,structField_ C "RtsFlags_DebugFlags_zero_on_gc"
+ "RTS_FLAGS" "DebugFlags.zero_on_gc"
,structField_ C "RtsFlags_GcFlags_initialStkSize"
"RTS_FLAGS" "GcFlags.initialStkSize"
,structField_ C "RtsFlags_MiscFlags_tickInterval"
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1c1e01c19beba39dfcaea49a8c55c78…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1c1e01c19beba39dfcaea49a8c55c78…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/T23162-part2] 5 commits: Improved fundeps for closed type families
by Simon Peyton Jones (@simonpj) 22 Dec '25
by Simon Peyton Jones (@simonpj) 22 Dec '25
22 Dec '25
Simon Peyton Jones pushed to branch wip/T23162-part2 at Glasgow Haskell Compiler / GHC
Commits:
b9b87080 by Simon Peyton Jones at 2025-12-22T17:25:00+00:00
Improved fundeps for closed type families
The big payload of this commit is to execute the plan suggested
in #23162, by improving the way that we generate functional
dependencies for closed type families.
It is all described in Note [Exploiting closed type families]
Most of the changes are in GHC.Tc.Solver.FunDeps
Other small changes
* GHC.Tc.Solver.bumpReductionDepth. This function brings together the code that
* Bumps the depth
* Checks for overflow
Previously the two were separated, sometimes quite widely.
* GHC.Core.Unify.niFixSubst: minor improvement, removing an unnecessary
itraetion in the base case.
* GHC.Core.Unify: no need to pass an InScopeSet to
tcUnifyTysForInjectivity. It can calculate one for itself; and it is
never inspected anyway so it's free to do so.
* GHC.Tc.Errors.Ppr: slight impovement to the error message for
reduction-stack overflow, when a constraint (rather than a type) is
involved.
* GHC.Tc.Solver.Monad.wrapUnifier: small change to the API
- - - - -
bbe6c5b6 by Simon Peyton Jones at 2025-12-22T17:25:00+00:00
Add missing (KK4) to kick-out criteria
There was a missing case in kick-out that meant we could fail
to solve an eminently-solvable constraint.
See the new notes about (KK4)
- - - - -
4f5af748 by Simon Peyton Jones at 2025-12-22T17:25:00+00:00
Some small refactorings of error reporting in the typechecker
This is just a tidy-up commit.
* Add ei_insoluble to ErrorItem, to cache insolubility.
Small tidy-up.
* Remove `is_ip` and `mkIPErr` from GHC.Tc.Errors; instead enhance mkDictErr
to handle implicit parameters. Small refactor.
- - - - -
1566cf6e by Simon Peyton Jones at 2025-12-22T17:25:00+00:00
Better fundeps for type-family Givens
This commit addresses #22652, by recording when the fundeps for
a constraint are definitely insoluble. That in turn improves the
perspicacity of the pattern-match overlap checker.
See Note [Insoluble fundeps]
- - - - -
737e11ab by Simon Peyton Jones at 2025-12-22T17:25:00+00:00
Fix a buglet in niFixSubst
The MR of which this is part failed an assertion check extendTvSubst
because we extended the TvSubst with a CoVar. Boo.
This tiny patch fixes it, and adds the regression test from #13882
that showed it up.
- - - - -
65 changed files:
- compiler/GHC/Core/FamInstEnv.hs
- compiler/GHC/Core/TyCo/Subst.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/FunDeps.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Rewrite.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/CtLoc.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Types/TyThing.hs
- docs/users_guide/9.16.1-notes.rst
- linters/lint-codes/LintCodes/Static.hs
- testsuite/tests/indexed-types/should_compile/CEqCanOccursCheck.hs
- testsuite/tests/indexed-types/should_fail/T12522a.hs
- testsuite/tests/indexed-types/should_fail/T26176.stderr
- testsuite/tests/parser/should_fail/RecordDotSyntaxFail10.stderr
- testsuite/tests/parser/should_fail/RecordDotSyntaxFail13.stderr
- testsuite/tests/pmcheck/should_compile/T15753c.hs
- + testsuite/tests/pmcheck/should_compile/T15753c.stderr
- testsuite/tests/pmcheck/should_compile/T15753d.hs
- + testsuite/tests/pmcheck/should_compile/T15753d.stderr
- + testsuite/tests/pmcheck/should_compile/T22652.hs
- + testsuite/tests/pmcheck/should_compile/T22652a.hs
- testsuite/tests/pmcheck/should_compile/all.T
- + testsuite/tests/polykinds/T13882.hs
- testsuite/tests/polykinds/all.T
- testsuite/tests/quantified-constraints/T15316A.stderr
- testsuite/tests/quantified-constraints/T17267.stderr
- testsuite/tests/quantified-constraints/T17267a.stderr
- testsuite/tests/quantified-constraints/T17267b.stderr
- testsuite/tests/quantified-constraints/T17267c.stderr
- testsuite/tests/quantified-constraints/T17267e.stderr
- testsuite/tests/quantified-constraints/T17458.stderr
- testsuite/tests/typecheck/should_compile/T16188.hs
- testsuite/tests/typecheck/should_fail/ContextStack1.stderr
- testsuite/tests/typecheck/should_fail/FD3.stderr
- testsuite/tests/typecheck/should_fail/FunDepOrigin1b.stderr
- testsuite/tests/typecheck/should_fail/T13506.stderr
- testsuite/tests/typecheck/should_fail/T15767.stderr
- testsuite/tests/typecheck/should_fail/T19415.stderr
- testsuite/tests/typecheck/should_fail/T19415b.stderr
- testsuite/tests/typecheck/should_fail/T22924b.stderr
- + testsuite/tests/typecheck/should_fail/T23162b.hs
- + testsuite/tests/typecheck/should_fail/T23162b.stderr
- + testsuite/tests/typecheck/should_fail/T23162c.hs
- + testsuite/tests/typecheck/should_fail/T23162d.hs
- testsuite/tests/typecheck/should_fail/T5236.stderr
- testsuite/tests/typecheck/should_fail/T5978.stderr
- testsuite/tests/typecheck/should_fail/T9612.stderr
- testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
- testsuite/tests/typecheck/should_fail/all.T
- testsuite/tests/typecheck/should_fail/tcfail143.stderr
- utils/haddock/haddock-api/src/Haddock/Convert.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c56164843e3d9030c2382b4722e9ca…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c56164843e3d9030c2382b4722e9ca…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/T23162-part2] 38 commits: base: generalize delete{Firsts,}By
by Simon Peyton Jones (@simonpj) 22 Dec '25
by Simon Peyton Jones (@simonpj) 22 Dec '25
22 Dec '25
Simon Peyton Jones pushed to branch wip/T23162-part2 at Glasgow Haskell Compiler / GHC
Commits:
b230d549 by mangoiv at 2025-12-16T15:17:45-05:00
base: generalize delete{Firsts,}By
When we delete{Firsts,}By we should not require the
lists to be the same type. This is an especially useful
generalisation in the case of deleteFirstsBy because we
can skip an invocation of the map function.
This change was discussed on the core-libraries-committee's bug
tracker at https://github.com/haskell/core-libraries-committee/issues/372.
- - - - -
6a2b43e3 by Cheng Shao at 2025-12-16T15:18:30-05:00
compiler: clean up redundant LANGUAGE pragmas
This patch bumps `default-language` of `ghc`/`ghc-bin` from `GHC2021`
to `GHC2024` (which is supported in ghc 9.10, current boot ghc lower
version bound), and also cleans up redundant `LANGUAGE` pragmas (as
well as `default-extensions`/`other-extensions`) that are already
implied by `GHC2024`.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
fca9cd7c by sheaf at 2025-12-18T13:18:18-05:00
X86 CodeGen: fix assign_eax_sse_regs
We must set %al to the number of SSE2 registers that contain arguments
(in case we are dealing with a varargs function). The logic for counting
how many arguments reside in SSE2 registers was incorrect, as it used
'isFloatFormat', which incorrectly ignores vector registers.
We now instead do case analysis on the register class:
is_sse_reg r =
case targetClassOfReg platform r of
RcFloatOrVector -> True
RcInteger -> False
This change is necessary to prevent segfaults in T20030_test1j, because
subsequent commits change the format calculations, resulting in vector
formats more often.
- - - - -
53150617 by sheaf at 2025-12-18T13:18:19-05:00
X86 regUsageOfInstr: fix format for IMUL
When used with 8-bit operands, the IMUL instruction returns the result
in the lower 16 bits of %rax (also known as %ax). This is different
than for the other sizes, where an input at 16, 32 or 64 bits will
result in 16, 32 or 64 bits of output in both %rax and %rdx.
This doesn't affect the behaviour of the compiler, because we don't
allow partial writes at sub-word sizes. The rationale is explained
in Wrinkle [Don't allow scalar partial writes] in Note [Register formats in liveness analysis],
in GHC.CmmToAsm.Reg.Liveness.
- - - - -
c7a56dd1 by sheaf at 2025-12-18T13:18:19-05:00
Liveness analysis: consider register formats
This commit updates the register allocator to be a bit more careful in
situations in which a single register is used at multiple different
formats, e.g. when xmm1 is used both to store a Double# and a DoubleX2#.
This is done by introducing the 'Regs' newtype around 'UniqSet RegWithFormat',
for which the combining operations take the larger of the two formats
instead of overriding the format.
Operations on 'Regs' are defined in 'GHC.CmmToAsm.Reg.Regs'. There is
a modest compile-time cost for the additional overhead for tracking
register formats, which causes the metric increases of this commit.
The subtle aspects of the implementation are outlined in
Note [Register formats in liveness analysis] in GHC.CmmToAsm.Reg.Liveness.
Fixes #26411 #26611
-------------------------
Metric Increase:
T12707
T26425
T3294
-------------------------
- - - - -
c2e83339 by sheaf at 2025-12-18T13:18:19-05:00
Register allocator: reload at same format as spill
This commit ensures that if we spill a register onto the stack at a
given format, we then always reload the register at this same format.
This ensures we don't end up in a situation where we spill F64x2 but end
up only reloading the lower F64. This first reload would make us believe
the whole data is in a register, thus silently losing the upper 64 bits
of the spilled register's contents.
Fixes #26526
- - - - -
55ab583b by sheaf at 2025-12-18T13:18:19-05:00
Register allocation: writes redefine format
As explained in Note [Allocated register formats] in GHC.CmmToAsm.Reg.Linear,
we consider all writes to redefine the format of the register.
This ensures that in a situation such as
movsd .Ln6m(%rip),%v1
shufpd $0,%v1,%v1
we properly consider the broadcast operation to change the format of %v1
from F64 to F64x2.
This completes the fix to #26411 (test in T26411b).
- - - - -
951402ed by Vladislav Zavialov at 2025-12-18T13:19:05-05:00
Parser: improve mkModuleImpExp, remove checkImportSpec
1. The `mkModuleImpExp` helper now knows whether it is processing an import or
export list item, and uses this information to produce a more accurate error
message for `import M (T(..,x))` with PatternSynonyms disabled.
The old message incorrectly referred to this case as an export form.
2. The `checkImportSpec` helper is removed in favor of more comprehensive error
checking in `mkModuleImpExp`.
3. Additionaly, the invariants of `ImpExpList` and `ImpExpAllWith` have been
made more explicit in the comments and assertions (calls to 'panic').
Test case: import-syntax-no-ext
- - - - -
47d83d96 by Vladislav Zavialov at 2025-12-18T13:19:06-05:00
Subordinate namespace-specified wildcards (#25901)
Add support for subordinate namespace-specified wildcards
`X(type ..)` and `X(data ..)` to import and export lists.
Examples:
import M (Cls(type ..)) -- imports Cls and all its associated types
import M (Cls(data ..)) -- imports Cls and all its methods
module M (R(data ..), C(type ..)) where
-- exports R and all its data constructors and record fields;
-- exports C and all its associated types, but not its methods
The scope of this change is limited to the case where the wildcard is the only
subordinate import/export item, whereas the more complex forms `X(type .., f)`
or `X(type .., data ..)` are unsupported and raise the newly introduced
PsErrUnsupportedExplicitNamespace error. This restriction may be lifted later.
Summary of the changes:
1. Refactor IEThingAll to store its extension field XIEThingAll as a record
IEThingAllExt instead of a tuple.
2. Extend the AST by adding a NamespaceSpecifier field to IEThingAllExt,
representing an optional namespace specifier `type` or `data` in front
of a subordinate wildcard `X(..)`.
3. Extend the grammar in Parser.y with productions for `type ..` and `data ..`
in subordinate import/export items.
4. Introduce `filterByNamespaceGREs` to filter [GlobalRdrElt] by a
NamespaceSpecifier; use it in `filterImports` and `exports_from_avail`
to account for the namespace specifier in IEThingAll.
5. Improve diagnostics by storing more information in DodgyImportsEmptyParent
and DodgyExportsEmptyParent.
Test cases:
T25901_sub_e T25901_sub_f T25901_sub_g T25901_sub_a
T25901_sub_b T25901_sub_c T25901_sub_d T25901_sub_w
DodgyImports02 DodgyImports03 DodgyImports04
- - - - -
eac418bb by Recursion Ninja at 2025-12-18T13:19:48-05:00
Removing the 'Data' instance for 'InstEnv'.
The 'Data' instance is blocking work on Trees that Grow, and the
'Data' instance seem to have been added without a clear purpose.
- - - - -
e920e038 by Recursion Ninja at 2025-12-18T13:19:48-05:00
'Decouple Language.Haskell.Syntax.Decls' from 'GHC.Unit.Module.Warnings'
- - - - -
bd38b76c by Cheng Shao at 2025-12-18T13:20:31-05:00
testsuite: improve coverage of foundation test
This patch refactors the `foundation` test a bit to improve coverage:
- Instead of using a hard-coded seed, a random seed is now taken from
the command line, and printed upon test failure. This improves test
coverage over many future CI runs, and shall a failure occur, the
seed is available in the CI log for local reproduction.
- The iterations count is bumped to 1000 instead of 100, similar to
the bump in `test-primops`. Runtime timeout is bumped 2x just to be
safe.
- Improve `newLCGGen` by using non-atomic loads/stores on a
`MutableByteArray#` for storing mutable `Word64`, this test doesn't
use parallelism in the first place
- Fixed a few compiler warnings and removed redundant pragmas and
imports
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
3995187c by Sylvain Henry at 2025-12-18T13:21:45-05:00
Doc: document -pgmi "" (#26634)
- - - - -
5729418c by Cheng Shao at 2025-12-18T13:22:29-05:00
rts: use __builtin_mul_overflow for hs_mulIntMayOflo
This patch uses `__builtin_mul_overflow` to implement
`hs_mulIntMayOflo`. This is a GNU C checked arithmetic builtin
function supported by gcc/clang, is type-generic so works for both
32-bit/64-bit, and makes the code both more efficient and easier to
read/maintain than the previous hand rolled logic.
- - - - -
1ca4b49a by Cheng Shao at 2025-12-18T13:23:11-05:00
compiler/rts: fix ABI mismatch in barf() invocations
This patch fixes a long-standing issue of ABI mismatch in `barf()`
invocations, both in compiler-emitted code and in hand written Cmm
code:
- In RTS, we have `barf()` which reports a fatal internal error
message and exits the program.
- `barf()` is a variadic C function! When used as a callee of a
foreign call with `ccall` calling convention instead of `capi`,
there is an ABI mismatch between the caller and the callee!
- Unfortunately, both the compiler and the Cmm sources contain many
places where we call `barf()` via `ccall` convention!! Like, when
you write `foreign "C" barf("foo object (%p) entered!", R1)`, it
totally doesn't do what you think it'll do at all!! The second
argument `R1` is not properly passed in `va_list`, and the behavior
is completely undefined!!
- Even more unfortunately, this issue has been sitting around long
enough because the ABI mismatch is subtle enough on normie platforms
like x64 and arm64.
- But there are platforms like wasm32 that are stricter about ABI, and
the broken `barf()` invocations already causes trouble for wasm
backend: we had to use ugly hacks like `barf(errmsg, NULL)` to make
`wasm-ld` happy, and even with this band-aid, compiler-generated
`barf()` invocations are still broken, resulting in regressions in
certain debug-related functionality, e.g. `-dtag-inference-checks`
is broken on wasm32 (#22882).
This patch properly fixes the issue:
- We add non-variadic `barf` wrappers in the RTS that can be used as
`ccall` callees
- Both the compiler `emitBarf` logic and the hand-written Cmm are
changed to call these wrappers
- `emitBarf` now also properly annotates the foreign call as
`CmmNeverReturns` to indicate it's a noreturn call to enable more
efficient code generation
`-dtag-inference-checks` now works on wasm. Closes #22882.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
b3dd23b9 by Vilim Lendvaj at 2025-12-18T13:23:57-05:00
Remove outdated comment
The Traversable instance for ZipList is no longer in
GHC.Internal.Data.Traversable. In fact, it is right below this very comment.
- - - - -
9a9c2f03 by Cheng Shao at 2025-12-18T13:24:39-05:00
compiler: remove unused OtherSection logic
This patch removes the OtherSection logic in Cmm, given it's never
actually used by any of our backends.
- - - - -
91edd292 by Wolfgang Jeltsch at 2025-12-19T03:18:19-05:00
Remove unused known-key and name variables for generics
This removes the known-key and corresponding name variables for `K1`,
`M1`, `R`, `D`, `C`, `S`, and `URec` from `GHC.Generics`, as they are
apparently nowhere used in GHC’s source code.
- - - - -
73ee7e38 by Wolfgang Jeltsch at 2025-12-19T03:19:02-05:00
Remove unused known keys and names for generics classes
This removes the known-key and corresponding name variables for
`Datatype`, `Constructor`, and `Selector` from `GHC.Generics`, as they
are apparently nowhere used in GHC’s source code.
- - - - -
f69c5f14 by Cheng Shao at 2025-12-19T03:19:45-05:00
wasm: fix handling of ByteArray#/MutableByteArray# arguments in JSFFI imports
This patch fixes the handling of ByteArray#/MutableByteArray#
arguments in JSFFI imports, see the amended note and manual for
explanation. Also adds a test to witness the fix.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
224446a2 by Cheng Shao at 2025-12-20T07:49:54-05:00
rts: workaround -Werror=maybe-uninitialized false positives
In some cases gcc might report -Werror=maybe-uninitialized that we
know are false positives, but need to workaround it to make validate
builds with -Werror pass.
- - - - -
251ec087 by Cheng Shao at 2025-12-20T07:49:54-05:00
hadrian: use -Og as C/C++ optimization level when debugging
This commit enables -Og as optimization level when compiling the debug
ways of rts. According to gcc documentation
(https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-Og)
-Og is a better choice than -O0 for producing debuggable code. It's
also supported by clang as well, so it makes sense to use it as a
default for debugging. Also add missing -g3 flag to C++ compilation
flags in +debug_info flavour transformer.
- - - - -
fb586c67 by Cheng Shao at 2025-12-20T07:50:36-05:00
compiler: replace DList with OrdList
This patch removes `DList` logic from the compiler and replaces it
with `OrdList` which also supports O(1) concatenation and should be
more memory efficient than the church-encoded `DList`.
- - - - -
8149c987 by Cheng Shao at 2025-12-20T17:06:51-05:00
hadrian: add with_profiled_libs flavour transformer
This patch adds a `with_profiled_libs` flavour transformer to hadrian
which is the exact opposite of `no_profiled_libs`. It adds profiling
ways to stage1+ rts/library ways, and doesn't alter other flavour
settings. It is useful when needing to test profiling logic locally
with a quick flavour.
- - - - -
746b18cd by Cheng Shao at 2025-12-20T17:06:51-05:00
hadrian: fix missing profiled dynamic libraries in profiled_ghc
This commit fixes the profiled_ghc flavour transformer to include
profiled dynamic libraries as well, since they're supported by GHC
since !12595.
- - - - -
4dd7e3b9 by Cheng Shao at 2025-12-20T17:07:33-05:00
ci: set http.postBuffer to mitigate perf notes timeout on some runners
This patch sets http.postBuffer to mitigate the timeout when fetching
perf notes on some runners with slow internet connection. Fixes #26684.
- - - - -
bc36268a by Wolfgang Jeltsch at 2025-12-21T16:23:24-05:00
Remove unused known keys and names for type representations
This removes the known-key and corresponding name variables for
`TrName`, `TrNameD`, `TypeRep`, `KindRepTypeLitD`, `TypeLitSort`, and
`mkTrType`, as they are apparently nowhere used in GHC’s source code.
- - - - -
ff5050e9 by Wolfgang Jeltsch at 2025-12-21T16:24:04-05:00
Remove unused known keys and names for natural operations
This removes the known-key and corresponding name variables for
`naturalAndNot`, `naturalLog2`, `naturalLogBaseWord`, `naturalLogBase`,
`naturalPowMod`, `naturalSizeInBase`, `naturalToFloat`, and
`naturalToDouble`, as they are apparently nowhere used in GHC’s source
code.
- - - - -
424388c2 by Wolfgang Jeltsch at 2025-12-21T16:24:45-05:00
Remove the unused known key and name for `Fingerprint`
This removes the variables for the known key and the name of the
`Fingerprint` data constructor, as they are apparently nowhere used in
GHC’s source code.
- - - - -
a1ed86fe by Wolfgang Jeltsch at 2025-12-21T16:25:26-05:00
Remove the unused known key and name for `failIO`
This removes the variables for the known key and the name of the
`failIO` operation, as they are apparently nowhere used in GHC’s source
code.
- - - - -
b8220daf by Wolfgang Jeltsch at 2025-12-21T16:26:07-05:00
Remove the unused known key and name for `liftM`
This removes the variables for the known key and the name of the `liftM`
operation, as they are apparently nowhere used in GHC’s source code.
- - - - -
eb0628b1 by Wolfgang Jeltsch at 2025-12-21T16:26:47-05:00
Fix the documentation of `hIsClosed`
- - - - -
672a79c0 by Simon Peyton Jones at 2025-12-22T17:03:14+00:00
Improved fundeps for closed type families
The big payload of this commit is to execute the plan suggested
in #23162, by improving the way that we generate functional
dependencies for closed type families.
It is all described in Note [Exploiting closed type families]
Most of the changes are in GHC.Tc.Solver.FunDeps
Other small changes
* GHC.Tc.Solver.bumpReductionDepth. This function brings together the code that
* Bumps the depth
* Checks for overflow
Previously the two were separated, sometimes quite widely.
* GHC.Core.Unify.niFixSubst: minor improvement, removing an unnecessary
itraetion in the base case.
* GHC.Core.Unify: no need to pass an InScopeSet to
tcUnifyTysForInjectivity. It can calculate one for itself; and it is
never inspected anyway so it's free to do so.
* GHC.Tc.Errors.Ppr: slight impovement to the error message for
reduction-stack overflow, when a constraint (rather than a type) is
involved.
* GHC.Tc.Solver.Monad.wrapUnifier: small change to the API
- - - - -
b432a066 by Simon Peyton Jones at 2025-12-22T17:03:14+00:00
Add missing (KK4) to kick-out criteria
There was a missing case in kick-out that meant we could fail
to solve an eminently-solvable constraint.
See the new notes about (KK4)
- - - - -
d20d4ea0 by Simon Peyton Jones at 2025-12-22T17:03:14+00:00
Some small refactorings of error reporting in the typechecker
This is just a tidy-up commit.
* Add ei_insoluble to ErrorItem, to cache insolubility.
Small tidy-up.
* Remove `is_ip` and `mkIPErr` from GHC.Tc.Errors; instead enhance mkDictErr
to handle implicit parameters. Small refactor.
- - - - -
eefb1891 by Simon Peyton Jones at 2025-12-22T17:03:14+00:00
Better fundeps for type-family Givens
This commit addresses #22652, by recording when the fundeps for
a constraint are definitely insoluble. That in turn improves the
perspicacity of the pattern-match overlap checker.
See Note [Insoluble fundeps]
- - - - -
924b266f by Simon Peyton Jones at 2025-12-22T17:03:14+00:00
Add release notes
- - - - -
c5616484 by Simon Peyton Jones at 2025-12-22T17:03:14+00:00
Fix a buglet in niFixSubst
The MR of which this is part failed an assertion check extendTvSubst
because we extended the TvSubst with a CoVar. Boo.
This tiny patch fixes it, and adds the regression test from #13882
that showed it up.
- - - - -
587 changed files:
- .gitlab/ci.sh
- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Builtin/PrimOps/Ids.hs
- compiler/GHC/Builtin/Types/Literals.hs
- compiler/GHC/Builtin/Utils.hs
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Breakpoints.hs
- compiler/GHC/ByteCode/InfoTable.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/ByteCode/Linker.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Cmm.hs
- compiler/GHC/Cmm/BlockId.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/CommonBlockElim.hs
- compiler/GHC/Cmm/Config.hs
- compiler/GHC/Cmm/ContFlowOpt.hs
- compiler/GHC/Cmm/Dataflow.hs
- compiler/GHC/Cmm/Dataflow/Block.hs
- compiler/GHC/Cmm/Dataflow/Graph.hs
- compiler/GHC/Cmm/Dataflow/Label.hs
- compiler/GHC/Cmm/DebugBlock.hs
- compiler/GHC/Cmm/Dominators.hs
- compiler/GHC/Cmm/Expr.hs
- compiler/GHC/Cmm/Graph.hs
- compiler/GHC/Cmm/Info/Build.hs
- compiler/GHC/Cmm/LRegSet.hs
- compiler/GHC/Cmm/LayoutStack.hs
- compiler/GHC/Cmm/Lint.hs
- compiler/GHC/Cmm/Liveness.hs
- compiler/GHC/Cmm/MachOp.hs
- compiler/GHC/Cmm/Node.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/ProcPoint.hs
- compiler/GHC/Cmm/Reducibility.hs
- compiler/GHC/Cmm/Reg.hs
- compiler/GHC/Cmm/Sink.hs
- compiler/GHC/Cmm/Switch.hs
- compiler/GHC/Cmm/Switch/Implement.hs
- compiler/GHC/Cmm/ThreadSanitizer.hs
- compiler/GHC/Cmm/UniqueRenamer.hs
- compiler/GHC/Cmm/Utils.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/BlockLayout.hs
- compiler/GHC/CmmToAsm/CFG.hs
- compiler/GHC/CmmToAsm/CPrim.hs
- compiler/GHC/CmmToAsm/Dwarf/Types.hs
- compiler/GHC/CmmToAsm/Format.hs
- compiler/GHC/CmmToAsm/LA64/CodeGen.hs
- compiler/GHC/CmmToAsm/LA64/Ppr.hs
- compiler/GHC/CmmToAsm/Monad.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/PPC/Ppr.hs
- compiler/GHC/CmmToAsm/Ppr.hs
- compiler/GHC/CmmToAsm/RV64/CodeGen.hs
- compiler/GHC/CmmToAsm/RV64/Ppr.hs
- compiler/GHC/CmmToAsm/Reg/Graph.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Coalesce.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs
- compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs
- compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs
- compiler/GHC/CmmToAsm/Reg/Linear.hs
- compiler/GHC/CmmToAsm/Reg/Linear/Base.hs
- compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs
- compiler/GHC/CmmToAsm/Reg/Linear/State.hs
- compiler/GHC/CmmToAsm/Reg/Linear/X86.hs
- compiler/GHC/CmmToAsm/Reg/Linear/X86_64.hs
- compiler/GHC/CmmToAsm/Reg/Liveness.hs
- + compiler/GHC/CmmToAsm/Reg/Regs.hs
- compiler/GHC/CmmToAsm/Reg/Target.hs
- compiler/GHC/CmmToAsm/Wasm.hs
- compiler/GHC/CmmToAsm/Wasm/Asm.hs
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- compiler/GHC/CmmToAsm/Wasm/Types.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/CmmToLlvm/Base.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/CmmToLlvm/Data.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Coercion.hs-boot
- compiler/GHC/Core/Coercion/Axiom.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/FamInstEnv.hs
- compiler/GHC/Core/InstEnv.hs
- compiler/GHC/Core/LateCC/OverloadedCalls.hs
- compiler/GHC/Core/LateCC/TopLevelBinds.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Lint/Interactive.hs
- compiler/GHC/Core/Map/Expr.hs
- compiler/GHC/Core/Map/Type.hs
- compiler/GHC/Core/Opt/CallerCC.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Core/Opt/Monad.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Ppr.hs
- compiler/GHC/Core/Predicate.hs
- compiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/Core/TyCo/Compare.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCo/Subst.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/TyCon/Env.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Type.hs-boot
- compiler/GHC/Core/Unify.hs
- compiler/GHC/CoreToStg.hs
- compiler/GHC/Data/Bag.hs
- compiler/GHC/Data/FastString.hs
- compiler/GHC/Data/Graph/Collapse.hs
- compiler/GHC/Data/Graph/Color.hs
- compiler/GHC/Data/Graph/Directed.hs
- compiler/GHC/Data/List/Infinite.hs
- compiler/GHC/Data/List/NonEmpty.hs
- compiler/GHC/Data/Maybe.hs
- compiler/GHC/Data/Pair.hs
- compiler/GHC/Data/Stream.hs
- compiler/GHC/Data/Strict.hs
- compiler/GHC/Data/StringBuffer.hs
- compiler/GHC/Data/TrieMap.hs
- compiler/GHC/Data/Word64Map.hs
- compiler/GHC/Driver/Backend.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/CmdLine.hs
- compiler/GHC/Driver/CodeOutput.hs
- compiler/GHC/Driver/Config/StgToCmm.hs
- compiler/GHC/Driver/Config/Tidy.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Env/KnotVars.hs
- compiler/GHC/Driver/Errors.hs
- compiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/Driver/Errors/Types.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/GenerateCgIPEStub.hs
- compiler/GHC/Driver/Hooks.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/MakeSem.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Pipeline/LogQueue.hs
- compiler/GHC/Driver/Pipeline/Monad.hs
- compiler/GHC/Driver/Pipeline/Phases.hs
- compiler/GHC/Driver/Plugins.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Driver/Session/Inspect.hs
- compiler/GHC/Driver/Session/Units.hs
- compiler/GHC/Hs.hs
- compiler/GHC/Hs/Basic.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Doc.hs
- compiler/GHC/Hs/Doc.hs-boot
- compiler/GHC/Hs/DocString.hs
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Expr.hs-boot
- compiler/GHC/Hs/Extension.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Lit.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Pat.hs-boot
- compiler/GHC/Hs/Stats.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Foreign/Decl.hs
- compiler/GHC/HsToCore/Foreign/Wasm.hs
- compiler/GHC/HsToCore/ListComp.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Match/Literal.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Pmc/Check.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Pmc/Solver.hs
- compiler/GHC/HsToCore/Pmc/Solver/Types.hs
- compiler/GHC/HsToCore/Pmc/Types.hs
- compiler/GHC/HsToCore/Pmc/Utils.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Utils.hs
- compiler/GHC/Iface/Binary.hs
- compiler/GHC/Iface/Decl.hs
- compiler/GHC/Iface/Env.hs
- compiler/GHC/Iface/Errors.hs
- compiler/GHC/Iface/Errors/Ppr.hs
- compiler/GHC/Iface/Errors/Types.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Ext/Debug.hs
- compiler/GHC/Iface/Ext/Types.hs
- compiler/GHC/Iface/Ext/Utils.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Iface/Rename.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/Iface/Type.hs
- compiler/GHC/Iface/Warnings.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/JS/Ident.hs
- compiler/GHC/JS/JStg/Monad.hs
- compiler/GHC/JS/JStg/Syntax.hs
- compiler/GHC/JS/Make.hs
- compiler/GHC/JS/Optimizer.hs
- compiler/GHC/JS/Ppr.hs
- compiler/GHC/JS/Syntax.hs
- compiler/GHC/JS/Transform.hs
- compiler/GHC/Linker/Deps.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Linker/Types.hs
- compiler/GHC/Llvm/MetaData.hs
- compiler/GHC/Llvm/Ppr.hs
- compiler/GHC/Llvm/Types.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/Errors/Basic.hs
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Parser/String.hs
- compiler/GHC/Parser/Types.hs
- compiler/GHC/Platform.hs
- compiler/GHC/Platform/Reg/Class.hs
- compiler/GHC/Platform/Reg/Class/NoVectors.hs
- compiler/GHC/Platform/Reg/Class/Separate.hs
- compiler/GHC/Platform/Reg/Class/Unified.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Expr.hs-boot
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Rename/Unbound.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Runtime/Heap/Layout.hs
- compiler/GHC/Runtime/Interpreter.hs
- compiler/GHC/Runtime/Interpreter/JS.hs
- compiler/GHC/Runtime/Interpreter/Process.hs
- compiler/GHC/Runtime/Interpreter/Types.hs
- compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs
- compiler/GHC/Settings/IO.hs
- compiler/GHC/Stg/Debug.hs
- compiler/GHC/Stg/EnforceEpt.hs
- compiler/GHC/Stg/EnforceEpt/Rewrite.hs
- compiler/GHC/Stg/EnforceEpt/TagSig.hs
- compiler/GHC/Stg/EnforceEpt/Types.hs
- compiler/GHC/Stg/FVs.hs
- compiler/GHC/Stg/Lift/Analysis.hs
- compiler/GHC/Stg/Lift/Monad.hs
- compiler/GHC/Stg/Lift/Types.hs
- compiler/GHC/Stg/Lint.hs
- compiler/GHC/Stg/Pipeline.hs
- compiler/GHC/Stg/Syntax.hs
- compiler/GHC/Stg/Unarise.hs
- compiler/GHC/Stg/Utils.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToCmm.hs
- compiler/GHC/StgToCmm/ArgRep.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/CgUtils.hs
- compiler/GHC/StgToCmm/Closure.hs
- compiler/GHC/StgToCmm/ExtCode.hs
- compiler/GHC/StgToCmm/InfoTableProv.hs
- compiler/GHC/StgToCmm/Lit.hs
- compiler/GHC/StgToCmm/Monad.hs
- compiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/StgToCmm/Utils.hs
- compiler/GHC/StgToJS/Apply.hs
- compiler/GHC/StgToJS/Arg.hs
- compiler/GHC/StgToJS/CodeGen.hs
- compiler/GHC/StgToJS/DataCon.hs
- compiler/GHC/StgToJS/Deps.hs
- compiler/GHC/StgToJS/Expr.hs
- compiler/GHC/StgToJS/ExprCtx.hs
- compiler/GHC/StgToJS/FFI.hs
- compiler/GHC/StgToJS/Heap.hs
- compiler/GHC/StgToJS/Linker/Linker.hs
- compiler/GHC/StgToJS/Linker/Opt.hs
- compiler/GHC/StgToJS/Linker/Types.hs
- compiler/GHC/StgToJS/Literal.hs
- compiler/GHC/StgToJS/Monad.hs
- compiler/GHC/StgToJS/Object.hs
- compiler/GHC/StgToJS/Rts/Rts.hs
- compiler/GHC/StgToJS/Rts/Types.hs
- compiler/GHC/StgToJS/Sinker/Collect.hs
- compiler/GHC/StgToJS/Sinker/Sinker.hs
- compiler/GHC/StgToJS/Sinker/StringsUnfloat.hs
- compiler/GHC/StgToJS/Types.hs
- compiler/GHC/StgToJS/Utils.hs
- compiler/GHC/SysTools.hs
- compiler/GHC/SysTools/Ar.hs
- compiler/GHC/SysTools/BaseDir.hs
- compiler/GHC/SysTools/Cpp.hs
- compiler/GHC/SysTools/Tasks.hs
- compiler/GHC/SysTools/Terminal.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Deriv/Functor.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Deriv/Generics.hs
- compiler/GHC/Tc/Deriv/Utils.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Hole.hs
- compiler/GHC/Tc/Errors/Hole/FitTypes.hs
- compiler/GHC/Tc/Errors/Hole/Plugin.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Errors/Types/PromotionErr.hs
- compiler/GHC/Tc/Gen/Annotation.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Arrow.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Default.hs
- compiler/GHC/Tc/Gen/Do.hs
- compiler/GHC/Tc/Gen/Export.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Foreign.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Instance/Family.hs
- compiler/GHC/Tc/Instance/FunDeps.hs
- compiler/GHC/Tc/Instance/Typeable.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/FunDeps.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Irred.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Rewrite.hs
- compiler/GHC/Tc/Solver/Types.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/TyCl/Utils.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/CtLoc.hs
- compiler/GHC/Tc/Types/ErrCtxt.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Backpack.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/Instantiate.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Tc/Validity.hs
- compiler/GHC/Tc/Zonk/Monad.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Annotations.hs
- compiler/GHC/Types/Avail.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/CompleteMatch.hs
- compiler/GHC/Types/CostCentre.hs
- compiler/GHC/Types/CostCentre/State.hs
- compiler/GHC/Types/DefaultEnv.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Error.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/FieldLabel.hs
- compiler/GHC/Types/Fixity.hs
- compiler/GHC/Types/ForeignCall.hs
- compiler/GHC/Types/ForeignStubs.hs
- compiler/GHC/Types/GREInfo.hs
- compiler/GHC/Types/Hint.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/GHC/Types/Id/Info.hs
- compiler/GHC/Types/Id/Make.hs
- compiler/GHC/Types/Literal.hs
- compiler/GHC/Types/Name.hs
- compiler/GHC/Types/Name/Cache.hs
- compiler/GHC/Types/Name/Occurrence.hs
- compiler/GHC/Types/Name/Reader.hs
- compiler/GHC/Types/Name/Set.hs
- compiler/GHC/Types/PkgQual.hs
- compiler/GHC/Types/RepType.hs
- compiler/GHC/Types/SaneDouble.hs
- compiler/GHC/Types/SourceText.hs
- compiler/GHC/Types/SrcLoc.hs
- compiler/GHC/Types/Tickish.hs
- compiler/GHC/Types/TyThing.hs
- compiler/GHC/Types/Unique/DFM.hs
- compiler/GHC/Types/Unique/DSet.hs
- compiler/GHC/Types/Unique/FM.hs
- compiler/GHC/Types/Unique/Map.hs
- compiler/GHC/Types/Unique/SDFM.hs
- compiler/GHC/Types/Unique/Set.hs
- compiler/GHC/Types/Var.hs
- compiler/GHC/Unit.hs
- compiler/GHC/Unit/Env.hs
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Unit/Home/PackageTable.hs
- compiler/GHC/Unit/Info.hs
- compiler/GHC/Unit/Module.hs
- compiler/GHC/Unit/Module/Deps.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Unit/Module/ModIface.hs
- compiler/GHC/Unit/Module/ModSummary.hs
- compiler/GHC/Unit/Module/Status.hs
- compiler/GHC/Unit/Module/Warnings.hs
- compiler/GHC/Unit/Module/WholeCoreBindings.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Unit/Types.hs-boot
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Binary/Typeable.hs
- compiler/GHC/Utils/Exception.hs
- compiler/GHC/Utils/Json.hs
- compiler/GHC/Utils/Logger.hs
- compiler/GHC/Utils/Misc.hs
- compiler/GHC/Utils/Monad/Codensity.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/GHC/Utils/Panic.hs
- compiler/GHC/Utils/Panic/Plain.hs
- compiler/GHC/Wasm/ControlFlow.hs
- compiler/GHC/Wasm/ControlFlow/FromCmm.hs
- compiler/Language/Haskell/Syntax.hs
- compiler/Language/Haskell/Syntax/Basic.hs
- compiler/Language/Haskell/Syntax/Binds.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/Expr.hs-boot
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- compiler/Language/Haskell/Syntax/Lit.hs
- compiler/Language/Haskell/Syntax/Pat.hs
- compiler/Language/Haskell/Syntax/Pat.hs-boot
- compiler/Language/Haskell/Syntax/Type.hs
- compiler/ghc.cabal.in
- docs/users_guide/9.16.1-notes.rst
- docs/users_guide/phases.rst
- docs/users_guide/wasm.rst
- ghc/GHC/Driver/Session/Lint.hs
- ghc/GHC/Driver/Session/Mode.hs
- ghc/GHCi/Leak.hs
- ghc/GHCi/UI.hs
- ghc/GHCi/UI/Exception.hs
- ghc/GHCi/UI/Info.hs
- ghc/GHCi/UI/Monad.hs
- ghc/Main.hs
- ghc/ghc-bin.cabal.in
- hadrian/doc/flavours.md
- hadrian/src/Flavour.hs
- hadrian/src/Settings/Packages.hs
- libraries/base/changelog.md
- libraries/ghc-internal/src/GHC/Internal/Data/OldList.hs
- libraries/ghc-internal/src/GHC/Internal/Functor/ZipList.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle.hs
- linters/lint-codes/LintCodes/Static.hs
- rts/Apply.cmm
- rts/Compact.cmm
- rts/ContinuationOps.cmm
- rts/Exception.cmm
- rts/Jumps.h
- rts/PrimOps.cmm
- rts/RtsMessages.c
- rts/StgMiscClosures.cmm
- rts/StgStartup.cmm
- rts/include/Stg.h
- rts/include/rts/Messages.h
- rts/linker/InitFini.c
- rts/prim/mulIntMayOflo.c
- rts/sm/Sanity.c
- testsuite/tests/diagnostic-codes/codes.stdout
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/indexed-types/should_compile/CEqCanOccursCheck.hs
- testsuite/tests/indexed-types/should_fail/T12522a.hs
- testsuite/tests/indexed-types/should_fail/T26176.stderr
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/jsffi/all.T
- + testsuite/tests/jsffi/bytearrayarg.hs
- + testsuite/tests/jsffi/bytearrayarg.mjs
- + testsuite/tests/jsffi/bytearrayarg.stdout
- testsuite/tests/numeric/should_run/all.T
- testsuite/tests/numeric/should_run/foundation.hs
- testsuite/tests/numeric/should_run/foundation.stdout
- testsuite/tests/parser/should_fail/RecordDotSyntaxFail10.stderr
- testsuite/tests/parser/should_fail/RecordDotSyntaxFail13.stderr
- testsuite/tests/patsyn/should_fail/all.T
- + testsuite/tests/patsyn/should_fail/import-syntax-no-ext.hs
- + testsuite/tests/patsyn/should_fail/import-syntax-no-ext.stderr
- testsuite/tests/perf/should_run/all.T
- testsuite/tests/pmcheck/should_compile/T15753c.hs
- + testsuite/tests/pmcheck/should_compile/T15753c.stderr
- testsuite/tests/pmcheck/should_compile/T15753d.hs
- + testsuite/tests/pmcheck/should_compile/T15753d.stderr
- + testsuite/tests/pmcheck/should_compile/T22652.hs
- + testsuite/tests/pmcheck/should_compile/T22652a.hs
- testsuite/tests/pmcheck/should_compile/all.T
- + testsuite/tests/polykinds/T13882.hs
- testsuite/tests/polykinds/all.T
- testsuite/tests/quantified-constraints/T15316A.stderr
- testsuite/tests/quantified-constraints/T17267.stderr
- testsuite/tests/quantified-constraints/T17267a.stderr
- testsuite/tests/quantified-constraints/T17267b.stderr
- testsuite/tests/quantified-constraints/T17267c.stderr
- testsuite/tests/quantified-constraints/T17267e.stderr
- testsuite/tests/quantified-constraints/T17458.stderr
- + testsuite/tests/rename/should_compile/T25901_sub_e.hs
- + testsuite/tests/rename/should_compile/T25901_sub_f.hs
- + testsuite/tests/rename/should_compile/T25901_sub_f.stderr
- + testsuite/tests/rename/should_compile/T25901_sub_g.hs
- + testsuite/tests/rename/should_compile/T25901_sub_g.stderr
- + testsuite/tests/rename/should_compile/T25901_sub_g_helper.hs
- testsuite/tests/rename/should_compile/all.T
- testsuite/tests/rename/should_fail/T23570b.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_a.hs
- + testsuite/tests/rename/should_fail/T25901_sub_a.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_b.hs
- + testsuite/tests/rename/should_fail/T25901_sub_b.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_c.hs
- + testsuite/tests/rename/should_fail/T25901_sub_c.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_c_helper.hs
- + testsuite/tests/rename/should_fail/T25901_sub_d.hs
- + testsuite/tests/rename/should_fail/T25901_sub_d.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_d_helper.hs
- + testsuite/tests/rename/should_fail/T25901_sub_w.hs
- + testsuite/tests/rename/should_fail/T25901_sub_w.stderr
- testsuite/tests/rename/should_fail/all.T
- + testsuite/tests/simd/should_run/T26411.hs
- + testsuite/tests/simd/should_run/T26411.stdout
- + testsuite/tests/simd/should_run/T26411b.hs
- + testsuite/tests/simd/should_run/T26411b.stdout
- testsuite/tests/simd/should_run/all.T
- testsuite/tests/simplStg/should_compile/all.T
- testsuite/tests/typecheck/should_compile/T16188.hs
- testsuite/tests/typecheck/should_fail/ContextStack1.stderr
- testsuite/tests/typecheck/should_fail/FD3.stderr
- testsuite/tests/typecheck/should_fail/FunDepOrigin1b.stderr
- testsuite/tests/typecheck/should_fail/T13506.stderr
- testsuite/tests/typecheck/should_fail/T15767.stderr
- testsuite/tests/typecheck/should_fail/T19415.stderr
- testsuite/tests/typecheck/should_fail/T19415b.stderr
- testsuite/tests/typecheck/should_fail/T22924b.stderr
- + testsuite/tests/typecheck/should_fail/T23162b.hs
- + testsuite/tests/typecheck/should_fail/T23162b.stderr
- + testsuite/tests/typecheck/should_fail/T23162c.hs
- + testsuite/tests/typecheck/should_fail/T23162d.hs
- testsuite/tests/typecheck/should_fail/T5236.stderr
- testsuite/tests/typecheck/should_fail/T5978.stderr
- testsuite/tests/typecheck/should_fail/T9612.stderr
- testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
- testsuite/tests/typecheck/should_fail/all.T
- testsuite/tests/typecheck/should_fail/tcfail143.stderr
- testsuite/tests/warnings/should_compile/DodgyExports03.stderr
- testsuite/tests/warnings/should_compile/DodgyImports.stderr
- + testsuite/tests/warnings/should_compile/DodgyImports02.hs
- + testsuite/tests/warnings/should_compile/DodgyImports02.stderr
- + testsuite/tests/warnings/should_compile/DodgyImports03.hs
- + testsuite/tests/warnings/should_compile/DodgyImports03.stderr
- + testsuite/tests/warnings/should_compile/DodgyImports03_helper.hs
- + testsuite/tests/warnings/should_compile/DodgyImports04.hs
- + testsuite/tests/warnings/should_compile/DodgyImports04.stderr
- testsuite/tests/warnings/should_compile/DodgyImports_hiding.stderr
- testsuite/tests/warnings/should_compile/all.T
- utils/check-exact/ExactPrint.hs
- utils/genapply/Main.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0432673bdcba2c3c696f713b59c3ef…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0432673bdcba2c3c696f713b59c3ef…
You're receiving this email because of your account on gitlab.haskell.org.
1
0