
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: fe6ed8d9 by Sylvain Henry at 2025-04-24T18:04:12-04:00 Doc: add doc for JS interruptible calling convention (#24444) - - - - - 6111c5e4 by Ben Gamari at 2025-04-24T18:04:53-04:00 compiler: Ensure that Panic.Plain.assertPanic' provides callstack In 36cddd2ce1a3bc62ea8a1307d8bc6006d54109cf @alt-romes removed CallStack output from `GHC.Utils.Panic.Plain.assertPanic'`. While this output is redundant due to the exception backtrace proposal, we may be bootstrapping with a compiler which does not yet include this machinery. Reintroduce the output for now. Fixes #25898. - - - - - 217caad1 by Matthew Pickering at 2025-04-25T18:58:42+01:00 Implement Explicit Level Imports for Template Haskell This commit introduces the `ExplicitLevelImports` and `ImplicitStagePersistence` language extensions as proposed in GHC Proposal #682. Key Features ------------ - `ExplicitLevelImports` adds two new import modifiers - `splice` and `quote` - allowing precise control over the level at which imported identifiers are available - `ImplicitStagePersistence` (enabled by default) preserves existing path-based cross-stage persistence behavior - `NoImplicitStagePersistence` disables implicit cross-stage persistence, requiring explicit level imports Benefits -------- - Improved compilation performance by reducing unnecessary code generation - Enhanced IDE experience with faster feedback in `-fno-code` mode - Better dependency tracking by distinguishing compile-time and runtime dependencies - Foundation for future cross-compilation improvements This implementation enables the separation of modules needed at compile-time from those needed at runtime, allowing for more efficient compilation pipelines and clearer code organization in projects using Template Haskell. Implementation Notes -------------------- The level which a name is availble at is stored in the 'GRE', in the normal GlobalRdrEnv. The function `greLevels` returns the levels which a specific GRE is imported at. The level information for a 'Name' is computed by `getCurrentAndBindLevel`. The level validity is checked by `checkCrossLevelLifting`. Instances are checked by `checkWellLevelledDFun`, which computes the level an instance by calling `checkWellLevelledInstanceWhat`, which sees what is available at by looking at the module graph. Modifications to downsweep -------------------------- Code generation is now only enabled for modules which are needed at compile time. See the Note [-fno-code mode] for more information. Uniform error messages for level errors --------------------------------------- All error messages to do with levels are now reported uniformly using the `TcRnBadlyStaged` constructor. Error messages are uniformly reported in terms of levels. 0 - top-level 1 - quote level -1 - splice level The only level hard-coded into the compiler is the top-level in GHC.Types.ThLevelIndex.topLevelIndex. Uniformly refer to levels and stages ------------------------------------ There was much confusion about levels vs stages in the compiler. A level is a semantic concept, used by the typechecker to ensure a program can be evaluated in a well-staged manner. A stage is an operational construct, program evaluation proceeds in stages. Deprecate -Wbadly-staged-types ------------------------------ `-Wbadly-staged-types` is deprecated in favour of `-Wbadly-levelled-types`. Lift derivation changed ----------------------- Derived lift instances will now not generate code with expression quotations. Before: ``` data A = A Int deriving Lift => lift (A x) = [| A $(lift x) |] ``` After: ``` lift (A x) = conE 'A `appE` (lift x) ``` This is because if you attempt to derive `Lift` in a module where `NoImplicitStagePersistence` is enabled, you would get an infinite loop where a constructor was attempted to be persisted using the instance you are currently defining. GHC API Changes --------------- The ModuleGraph now contains additional information about the type of the edges (normal, quote or splice) between modules. This is abstracted using the `ModuleGraphEdge` data type. Fixes #25828 ------------------------- Metric Increase: MultiLayerModulesTH_Make ------------------------- - - - - - b39228a6 by Simon Peyton Jones at 2025-04-26T15:34:09-04:00 Get a decent MatchContext for pattern synonym bindings In particular when we have a pattern binding K p1 .. pn = rhs where K is a pattern synonym. (It might be nested.) This small MR fixes #25995. It's a tiny fix, to an error message, removing an always-dubious `unkSkol`. The bug report was in the context of horde-ad, a big program, and I didn't manage to make a small repro case quickly. I decided not to bother further. - - - - - 268 changed files: - compiler/GHC.hs - compiler/GHC/Data/Graph/Directed/Reachability.hs - compiler/GHC/Driver/Backpack.hs - compiler/GHC/Driver/Downsweep.hs - compiler/GHC/Driver/DynFlags.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/ImpExp.hs - compiler/GHC/Iface/Recomp.hs - compiler/GHC/Iface/Tidy.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/Errors/Ppr.hs - compiler/GHC/Parser/Errors/Types.hs - compiler/GHC/Parser/Header.hs - compiler/GHC/Parser/Lexer.x - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Env.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Names.hs - compiler/GHC/Rename/Splice.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Runtime/Loader.hs - compiler/GHC/Tc/Deriv/Generate.hs - compiler/GHC/Tc/Deriv/Utils.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/Pat.hs - compiler/GHC/Tc/Gen/Splice.hs - compiler/GHC/Tc/Module.hs - compiler/GHC/Tc/Plugin.hs - compiler/GHC/Tc/Solver/Dict.hs - compiler/GHC/Tc/Solver/Monad.hs - compiler/GHC/Tc/TyCl/Instance.hs - compiler/GHC/Tc/Types.hs - compiler/GHC/Tc/Types/LclEnv.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Types/TH.hs - compiler/GHC/Tc/Utils/Backpack.hs - compiler/GHC/Tc/Utils/Concrete.hs - compiler/GHC/Tc/Utils/Env.hs - compiler/GHC/Tc/Utils/Monad.hs - compiler/GHC/Tc/Utils/TcMType.hs - compiler/GHC/Types/Basic.hs - compiler/GHC/Types/Error/Codes.hs - compiler/GHC/Types/Name/Reader.hs - + compiler/GHC/Types/ThLevelIndex.hs - compiler/GHC/Unit/Home/PackageTable.hs - compiler/GHC/Unit/Module/Deps.hs - compiler/GHC/Unit/Module/Graph.hs - compiler/GHC/Unit/Module/Imported.hs - compiler/GHC/Unit/Module/ModSummary.hs - + compiler/GHC/Unit/Module/Stage.hs - compiler/GHC/Unit/Types.hs - compiler/GHC/Utils/Binary.hs - compiler/GHC/Utils/Outputable.hs - compiler/GHC/Utils/Panic/Plain.hs - compiler/Language/Haskell/Syntax/ImpExp.hs - + compiler/Language/Haskell/Syntax/ImpExp/IsBoot.hs - compiler/ghc.cabal.in - docs/users_guide/exts/control.rst - docs/users_guide/exts/template_haskell.rst - docs/users_guide/javascript.rst - docs/users_guide/phases.rst - docs/users_guide/using-warnings.rst - ghc/GHCi/UI.hs - libraries/base/tests/IO/Makefile - libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs - testsuite/tests/ado/ado004.stderr - testsuite/tests/annotations/should_fail/annfail03.stderr - testsuite/tests/annotations/should_fail/annfail04.stderr - testsuite/tests/annotations/should_fail/annfail06.stderr - testsuite/tests/annotations/should_fail/annfail09.stderr - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/dependent/should_compile/T14729.stderr - testsuite/tests/dependent/should_compile/T15743.stderr - testsuite/tests/dependent/should_compile/T15743e.stderr - testsuite/tests/deriving/should_compile/T14682.stderr - testsuite/tests/determinism/determ021/determ021.stdout - + testsuite/tests/driver/T4437.stdout - testsuite/tests/driver/json2.stderr - testsuite/tests/gadt/T19847a.stderr - testsuite/tests/ghc-api/fixed-nodes/FixedNodes.hs - testsuite/tests/ghc-api/fixed-nodes/ModuleGraphInvariants.hs - testsuite/tests/indexed-types/should_compile/T15711.stderr - testsuite/tests/indexed-types/should_compile/T15852.stderr - testsuite/tests/indexed-types/should_compile/T3017.stderr - testsuite/tests/interface-stability/template-haskell-exports.stdout - testsuite/tests/module/mod185.stderr - testsuite/tests/parser/should_compile/DumpParsedAst.stderr - testsuite/tests/parser/should_compile/DumpRenamedAst.stderr - testsuite/tests/parser/should_compile/DumpSemis.stderr - testsuite/tests/parser/should_compile/KindSigs.stderr - testsuite/tests/parser/should_compile/T14189.stderr - testsuite/tests/partial-sigs/should_compile/ADT.stderr - testsuite/tests/partial-sigs/should_compile/AddAndOr1.stderr - testsuite/tests/partial-sigs/should_compile/AddAndOr2.stderr - testsuite/tests/partial-sigs/should_compile/AddAndOr3.stderr - testsuite/tests/partial-sigs/should_compile/AddAndOr4.stderr - testsuite/tests/partial-sigs/should_compile/AddAndOr5.stderr - testsuite/tests/partial-sigs/should_compile/AddAndOr6.stderr - testsuite/tests/partial-sigs/should_compile/BoolToBool.stderr - testsuite/tests/partial-sigs/should_compile/DataFamilyInstanceLHS.stderr - testsuite/tests/partial-sigs/should_compile/Defaulting1MROn.stderr - testsuite/tests/partial-sigs/should_compile/Defaulting2MROff.stderr - testsuite/tests/partial-sigs/should_compile/Defaulting2MROn.stderr - testsuite/tests/partial-sigs/should_compile/Either.stderr - testsuite/tests/partial-sigs/should_compile/EqualityConstraint.stderr - testsuite/tests/partial-sigs/should_compile/Every.stderr - testsuite/tests/partial-sigs/should_compile/EveryNamed.stderr - testsuite/tests/partial-sigs/should_compile/ExpressionSig.stderr - testsuite/tests/partial-sigs/should_compile/ExpressionSigNamed.stderr - testsuite/tests/partial-sigs/should_compile/ExtraConstraints1.stderr - testsuite/tests/partial-sigs/should_compile/ExtraConstraints2.stderr - testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr - testsuite/tests/partial-sigs/should_compile/ExtraNumAMROff.stderr - testsuite/tests/partial-sigs/should_compile/ExtraNumAMROn.stderr - testsuite/tests/partial-sigs/should_compile/Forall1.stderr - testsuite/tests/partial-sigs/should_compile/GenNamed.stderr - testsuite/tests/partial-sigs/should_compile/HigherRank1.stderr - testsuite/tests/partial-sigs/should_compile/HigherRank2.stderr - testsuite/tests/partial-sigs/should_compile/LocalDefinitionBug.stderr - testsuite/tests/partial-sigs/should_compile/Meltdown.stderr - testsuite/tests/partial-sigs/should_compile/MonoLocalBinds.stderr - testsuite/tests/partial-sigs/should_compile/NamedTyVar.stderr - testsuite/tests/partial-sigs/should_compile/NamedWildcardInDataFamilyInstanceLHS.stderr - testsuite/tests/partial-sigs/should_compile/NamedWildcardInTypeFamilyInstanceLHS.stderr - testsuite/tests/partial-sigs/should_compile/ParensAroundContext.stderr - testsuite/tests/partial-sigs/should_compile/PatBind.stderr - testsuite/tests/partial-sigs/should_compile/PatBind2.stderr - testsuite/tests/partial-sigs/should_compile/PatternSig.stderr - testsuite/tests/partial-sigs/should_compile/Recursive.stderr - testsuite/tests/partial-sigs/should_compile/ScopedNamedWildcards.stderr - testsuite/tests/partial-sigs/should_compile/ScopedNamedWildcardsGood.stderr - testsuite/tests/partial-sigs/should_compile/ShowNamed.stderr - testsuite/tests/partial-sigs/should_compile/SimpleGen.stderr - testsuite/tests/partial-sigs/should_compile/SkipMany.stderr - testsuite/tests/partial-sigs/should_compile/SomethingShowable.stderr - testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.stderr - testsuite/tests/partial-sigs/should_compile/Uncurry.stderr - testsuite/tests/partial-sigs/should_compile/UncurryNamed.stderr - testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr - testsuite/tests/polykinds/T15592.stderr - testsuite/tests/polykinds/T15592b.stderr - testsuite/tests/printer/T18052a.stderr - testsuite/tests/quasiquotation/qq001/qq001.stderr - testsuite/tests/quasiquotation/qq002/qq002.stderr - testsuite/tests/quasiquotation/qq003/qq003.stderr - testsuite/tests/quasiquotation/qq004/qq004.stderr - + testsuite/tests/quotes/T5721.stderr - testsuite/tests/roles/should_compile/Roles1.stderr - testsuite/tests/roles/should_compile/Roles14.stderr - testsuite/tests/roles/should_compile/Roles2.stderr - testsuite/tests/roles/should_compile/Roles3.stderr - testsuite/tests/roles/should_compile/Roles4.stderr - testsuite/tests/roles/should_compile/T8958.stderr - testsuite/tests/showIface/DocsInHiFile1.stdout - testsuite/tests/showIface/DocsInHiFileTH.stdout - testsuite/tests/showIface/HaddockIssue849.stdout - testsuite/tests/showIface/HaddockOpts.stdout - testsuite/tests/showIface/HaddockSpanIssueT24378.stdout - testsuite/tests/showIface/LanguageExts.stdout - testsuite/tests/showIface/MagicHashInHaddocks.stdout - testsuite/tests/showIface/NoExportList.stdout - testsuite/tests/showIface/PragmaDocs.stdout - testsuite/tests/showIface/ReExports.stdout - + testsuite/tests/splice-imports/ClassA.hs - + testsuite/tests/splice-imports/InstanceA.hs - + testsuite/tests/splice-imports/Makefile - + testsuite/tests/splice-imports/SI01.hs - + testsuite/tests/splice-imports/SI01A.hs - + testsuite/tests/splice-imports/SI02.hs - + testsuite/tests/splice-imports/SI03.hs - + testsuite/tests/splice-imports/SI03.stderr - + testsuite/tests/splice-imports/SI04.hs - + testsuite/tests/splice-imports/SI05.hs - + testsuite/tests/splice-imports/SI05.stderr - + testsuite/tests/splice-imports/SI05A.hs - + testsuite/tests/splice-imports/SI06.hs - + testsuite/tests/splice-imports/SI07.hs - + testsuite/tests/splice-imports/SI07.stderr - + testsuite/tests/splice-imports/SI07A.hs - + testsuite/tests/splice-imports/SI08.hs - + testsuite/tests/splice-imports/SI08.stderr - + testsuite/tests/splice-imports/SI08_oneshot.stderr - + testsuite/tests/splice-imports/SI09.hs - + testsuite/tests/splice-imports/SI10.hs - + testsuite/tests/splice-imports/SI13.hs - + testsuite/tests/splice-imports/SI14.hs - + testsuite/tests/splice-imports/SI14.stderr - + testsuite/tests/splice-imports/SI15.hs - + testsuite/tests/splice-imports/SI15.stderr - + testsuite/tests/splice-imports/SI16.hs - + testsuite/tests/splice-imports/SI16.stderr - + testsuite/tests/splice-imports/SI17.hs - + testsuite/tests/splice-imports/SI18.hs - + testsuite/tests/splice-imports/SI18.stderr - + testsuite/tests/splice-imports/SI19.hs - + testsuite/tests/splice-imports/SI19A.hs - + testsuite/tests/splice-imports/SI20.hs - + testsuite/tests/splice-imports/SI20.stderr - + testsuite/tests/splice-imports/SI21.hs - + testsuite/tests/splice-imports/SI21.stderr - + testsuite/tests/splice-imports/SI22.hs - + testsuite/tests/splice-imports/SI22.stderr - + testsuite/tests/splice-imports/SI23.hs - + testsuite/tests/splice-imports/SI23A.hs - + testsuite/tests/splice-imports/SI24.hs - + testsuite/tests/splice-imports/SI25.hs - + testsuite/tests/splice-imports/SI25.stderr - + testsuite/tests/splice-imports/SI25Helper.hs - + testsuite/tests/splice-imports/SI26.hs - + testsuite/tests/splice-imports/SI27.hs - + testsuite/tests/splice-imports/SI27.stderr - + testsuite/tests/splice-imports/SI28.hs - + testsuite/tests/splice-imports/SI28.stderr - + testsuite/tests/splice-imports/SI29.hs - + testsuite/tests/splice-imports/SI29.stderr - + testsuite/tests/splice-imports/SI30.script - + testsuite/tests/splice-imports/SI30.stdout - + testsuite/tests/splice-imports/SI31.script - + testsuite/tests/splice-imports/SI31.stderr - + testsuite/tests/splice-imports/SI32.script - + testsuite/tests/splice-imports/SI32.stdout - + testsuite/tests/splice-imports/SI33.script - + testsuite/tests/splice-imports/SI33.stdout - + testsuite/tests/splice-imports/SI34.hs - + testsuite/tests/splice-imports/SI34.stderr - + testsuite/tests/splice-imports/SI34M1.hs - + testsuite/tests/splice-imports/SI34M2.hs - + testsuite/tests/splice-imports/SI35.hs - + testsuite/tests/splice-imports/SI35A.hs - + testsuite/tests/splice-imports/SI36.hs - + testsuite/tests/splice-imports/SI36.stderr - + testsuite/tests/splice-imports/SI36_A.hs - + testsuite/tests/splice-imports/SI36_B1.hs - + testsuite/tests/splice-imports/SI36_B2.hs - + testsuite/tests/splice-imports/SI36_B3.hs - + testsuite/tests/splice-imports/SI36_C1.hs - + testsuite/tests/splice-imports/SI36_C2.hs - + testsuite/tests/splice-imports/SI36_C3.hs - + testsuite/tests/splice-imports/all.T - testsuite/tests/th/T16976z.stderr - testsuite/tests/th/T17820a.stderr - testsuite/tests/th/T17820b.stderr - testsuite/tests/th/T17820c.stderr - testsuite/tests/th/T17820d.stderr - testsuite/tests/th/T17820e.stderr - testsuite/tests/th/T21547.stderr - testsuite/tests/th/T23829_hasty.stderr - testsuite/tests/th/T23829_hasty_b.stderr - testsuite/tests/th/T23829_tardy.ghc.stderr - testsuite/tests/th/T5795.stderr - testsuite/tests/th/TH_Roles2.stderr - testsuite/tests/typecheck/should_compile/T12763.stderr - testsuite/tests/typecheck/should_compile/T18406b.stderr - testsuite/tests/typecheck/should_compile/T18529.stderr - testsuite/tests/typecheck/should_compile/T21023.stderr - utils/check-exact/ExactPrint.hs - utils/count-deps/Main.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/271d4baa2ae8320363dbe89264045cf... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/271d4baa2ae8320363dbe89264045cf... You're receiving this email because of your account on gitlab.haskell.org.