Alan Zimmerman pushed to branch wip/az/exactprint-annotation-rationalisation at Glasgow Haskell Compiler / GHC Commits: d1d01fa5 by Wolfgang Jeltsch at 2026-08-27T13:17:59+03:00 Add `rethrowSTM` and improve STM-related documentation Adding `rethrowSTM` resolves #26758. The implementation of `rethrowSTM` is completely analogous to the one of `rethrowIO`. The following is established for the documentation of `throwSTM` and `catchSTM`: * Both operations are directly described as analogs of their `IO` counterparts. * There is no reference to `throw` in the documentation of `throwSTM`, because, although such a reference is great in the documentation of `throwIO`, it is somewhat out of place in the documentation of `throwSTM`. * Instead of repeating part of `throwIO`’s documentation, the documentation of `throwSTM` just recommends using `throwSTM` instead of `throw` and references the corresponding arguments in the documentation of `throwIO`. - - - - - 06fde293 by fendor at 2026-08-28T06:06:44-04:00 GHCi: Fix order of `PackageDBFlag`s for interactive home unit `PackageDBFlag`s are stored in reverse order of cli specification. When sorting the `PackageDBFlag`s by longest common prefix, we need thus to reverse the package db stacks before calculating the prefix. We make sure to reverse the package db stack for the interactive home unit to uphold that later specified package dbs overwrite earlier ones. Resolved and adds regression test for #27640 - - - - - 024c4d04 by fendor at 2026-08-28T06:07:23-04:00 Reuse the UnitIndexCache after initialising multiple home units - - - - - 55326fa0 by Alan Zimmerman at 2026-08-28T06:08:03-04:00 EPA: Some Haddock processing tweaks These changes to the Haddock postprocessing should not change behaviour, but just bring it more closely in line with the original, changed at 44309cd377f And add some haddock exactprint tests to show they work. - - - - - b3ddee95 by Andreas Klebinger at 2026-08-28T13:57:46-04:00 hadrian: Deprecate quickest flavour. It was more of a trap for new users than actually beneficial so we deprecate it and suggest quick+no_dynamic_libs to users instead. - - - - - a1d81390 by Andreas Klebinger at 2026-08-28T13:58:37-04:00 cmm: Always favour entry block during block deduplication. We now always keep the first block in the CmmGraph. This way we avoid the need to update the entry info table. Failing to do so caused #27722. Fixes #27722. - - - - - 5bd65f00 by Andreas Klebinger at 2026-08-28T13:59:16-04:00 test: FamAppCachePerf - Only collect bytes allocated. Fixes 27747 - - - - - e9c6b1d3 by Alan Zimmerman at 2026-08-29T13:02:56+01:00 EPA Fix HsCmdDo exact print with comments Exact printing of HsCmdDo was ignoring the location for the do statements, and this is an annotation that can have comments in it. Update it so we print the statements as a unit, including any comments. Also add the result of auditing that we capture comments in all needed places, noting that the remaining Anno SrcSpan instances are benign. - - - - - a58d91ee by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: Remove ListBanana / ListParens from AnnListBrackets - - - - - a16b92ae by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: Tidy up mkHsDoPv, take AnnList directly And some extra stuff by accident. The main goal is to slim down AnnListBrackets to just have braces or none. This makes it clear that it serves only for lists which may have layout, and opens the route to use EpLayout instead of AnnListBrackets - - - - - 8ea2fbae by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: Add specific layout field to AnnList - - - - - 925dc42e by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: Use EpaLocation in EpVirtualBraces reword: EPA Use vocurly as basis for AnnListLayout For the existing cases that populate AnnList. This also shows up AnnList usages that can never capture layout. - - - - - 433b7ad5 by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: Use vocurly as basis for AnnListLayout For the existing cases that populate AnnList. This also shows up AnnList usages that can never capture layout. - - - - - 85c3e0c8 by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: AnnList clean up patch for empty where clause - - - - - da6e6619 by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: Add TTG fields to FamilyInfo This commit is a simple add, with unused extension fields. It lays the groundwork for using them for exact print annotations - - - - - 10c45223 by Alan Zimmerman at 2026-08-29T13:05:21+01:00 WIP annclassdecl - - - - - d396098f by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: Update AnnClsInstDecl to contain AnnList It was already separately tracking the '{', '}' and leading ';' values. This aligns it with layout-introducing parser productions ('vocurly'), so the layout processing can be handled uniformly - - - - - 2c1b4504 by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: Tidy up markAnnListA' It takes an action which can modify the AnnList, but this is never used. So remove it. - - - - - abc2be7f by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: Use AnnList for GADT declarations - - - - - 5088c886 by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: Use AnnList in AnnClassDecl - - - - - a90b8091 by Alan Zimmerman at 2026-08-29T13:05:21+01:00 MOVE EPA: Plan for Fixing AnnList Layout Properly - - - - - 0e715517 by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: Make local binds located Use LHsLocalBinds instead of HsLocalBinds This reverses an earlier change, and brings processing of local binds into alignement with the exact printing principle that the LocatedA contents provide the location and extent of the enclosed item, together with any comments or context-specific trailing items like commas or semi colons. The internal TTG extension points only carry exact print annotations related to printing the item within its bounds. This change brings back the problem of EmptyLocalBinds, which by definition cannot have a location. These get a noSrcSpan location, which is ignored in the exact printing process. - - - - - 7da0d5df by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: Use AnnList in HsMultiIf It introduces layout, capture it - - - - - 46f4a16c by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: Use AnnList in DecBrl - - - - - b7a9ff4a by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: Replace AnnListLayout / AnnListBrackets with EpLayout - - - - - 888d7137 by Alan Zimmerman at 2026-08-29T13:05:21+01:00 WIP: setLayoutBoth inside markAnnListA Current problem is it is a global one-shot, and MG has one too Check: is it needed? if so, honouring EpLayout may be needed - - - - - 297dbd2d by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA some tests for layout. WIP - - - - - 42f5d7ae by Alan Zimmerman at 2026-08-29T13:05:21+01:00 Exactprint layout scope plan. Do not commit - - - - - 6d3b9ad3 by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: tidy up a bit. Combine somewhere else - - - - - 8fa54611 by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: Introduce LayoutFrame stacks in ExactPrint state - - - - - 06c27397 by Alan Zimmerman at 2026-08-29T13:05:21+01:00 Align with ghc-exactprint - - - - - 1b0782d2 by Alan Zimmerman at 2026-08-29T13:05:21+01:00 EPA: Fix AnnList leading semis when layout When there is layout, anything printed triggers it, including leading semis. Add some test case examples too - - - - - 1f1b180d by Alan Zimmerman at 2026-08-29T13:05:21+01:00 Exactprint: tidy up layout capturing - - - - - 882f9d68 by Alan Zimmerman at 2026-08-29T14:28:34+01:00 EPA: add makeDelta test for Test20297 The original #20297 related to comment placement for exact printing after running ExactPrint.makeDelta on ParsedSource. Add an additional test that explicitly tests this. - - - - - 5b9bcf1a by Alan Zimmerman at 2026-08-29T14:28:34+01:00 EPA: Make ValBinds LocatedA in HsLocalBindsLR If we have items with an AnnList Annotation, as part of another, which has different content, it must be LocatedA. This is a technical requirement due to the way comment allocation happens during the makeDelta processing. Comments are queued for printing, and as soon as any non-comment is to be printed, the pending comments before that position are printed, and in makeDelta processing these attached as preceding comments to the thing just printed. The means they end up captured inside the layout region of the AnnList item. So for foo = x where -- comment x = 3 the comment ends up as a preceding comment of `x = 3`, inside the layout, and prints as foo = x where -- comment x = 3 - - - - - babb1a27 by Alan Zimmerman at 2026-08-29T15:02:19+01:00 EPA: Make IPBinds LocatedA - - - - - cd7aabf7 by Alan Zimmerman at 2026-08-29T15:02:19+01:00 Extend Test20297 for additional occurrences - - - - - 80743934 by Alan Zimmerman at 2026-08-29T15:02:19+01:00 Plan update DO NOT COMMIT - - - - - 4c9e7330 by Alan Zimmerman at 2026-08-29T15:02:19+01:00 EPA: First pass implementation of HsList, for ClassDecls Just as a straight list replacement to start with, no payload. This shows the scope and invasiveness of the initial change - - - - - 0c308d7c by Alan Zimmerman at 2026-08-29T15:02:19+01:00 EPA: HsList attempt WIP - - - - - bdddf33d by Alan Zimmerman at 2026-08-29T15:02:19+01:00 Enable ppr test for Haddock1. It currently fails - - - - - 6aa9fbcd by Alan Zimmerman at 2026-08-29T15:02:19+01:00 WIP on removing NoEpAnn. Likely abandon - - - - - 924c20d7 by Alan Zimmerman at 2026-08-29T15:02:19+01:00 EPA: Add an overview doc for exact printing - - - - - a8da5c0c by Simon Peyton Jones at 2026-08-29T15:02:19+01:00 Added an intro section - - - - - 134 changed files: - + ANNLIST-LAYOUT-PLAN.md - + ExactPrint.md - + LAYOUT-SCOPE-PLAN.md - changelog.d/T27202 - + changelog.d/T27722-cbe-entry-block.md - + changelog.d/rethrow-stm - changelog.d/unit-index - compiler/GHC/Cmm/CommonBlockElim.hs - compiler/GHC/Driver/Backpack.hs - compiler/GHC/Driver/Main/Interactive.hs - compiler/GHC/Driver/Session/Units.hs - compiler/GHC/Hs.hs - compiler/GHC/Hs/Binds.hs - compiler/GHC/Hs/Decls.hs - compiler/GHC/Hs/Doc.hs - compiler/GHC/Hs/DocString.hs - compiler/GHC/Hs/Dump.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Extension/Pass.hs - compiler/GHC/Hs/ImpExp.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Pat.hs - compiler/GHC/Hs/Stats.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Expr.hs-boot - compiler/GHC/HsToCore/Match.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - compiler/GHC/Rename/Bind.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Splice.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Runtime/Eval.hs - compiler/GHC/Tc/Deriv.hs - compiler/GHC/Tc/Deriv/Functor.hs - compiler/GHC/Tc/Deriv/Generate.hs - compiler/GHC/Tc/Gen/Arrow.hs - compiler/GHC/Tc/Gen/Bind.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Module.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/PatSyn.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/ThToHs.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/Extension.hs - ghc/GHCi/UI.hs - hadrian/README.md - hadrian/doc/cross-compile.md - hadrian/doc/flavours.md - hadrian/doc/make.md - hadrian/doc/windows.md - hadrian/hadrian.cabal - hadrian/src/CommandLine.hs - hadrian/src/Flavour.hs - hadrian/src/Settings.hs - − hadrian/src/Settings/Flavours/Quickest.hs - libraries/base/src/GHC/Conc.hs - libraries/ghc-internal/src/GHC/Internal/STM.hs - testsuite/tests/ghc-api/T25121_status.stdout - testsuite/tests/ghc-api/exactprint/T22919.stderr - testsuite/tests/ghc-api/exactprint/Test20239.stderr - testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr - + testsuite/tests/ghci/prog-mhu007/Makefile - + testsuite/tests/ghci/prog-mhu007/a/A.hs - + testsuite/tests/ghci/prog-mhu007/all.T - + testsuite/tests/ghci/prog-mhu007/b/B.hs - + testsuite/tests/ghci/prog-mhu007/prog-mhu007.script - + testsuite/tests/ghci/prog-mhu007/prog-mhu007.stdout - + testsuite/tests/ghci/prog-mhu007/testpkg-bar/Bar.hs - + testsuite/tests/ghci/prog-mhu007/testpkg-bar/testpkg-bar.pkg - + testsuite/tests/ghci/prog-mhu007/testpkg-foo/Foo.hs - + testsuite/tests/ghci/prog-mhu007/testpkg-foo/testpkg-foo.pkg - + testsuite/tests/ghci/prog-mhu007/unitA - + testsuite/tests/ghci/prog-mhu007/unitB - testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr - testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr - testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr - testsuite/tests/module/mod185.stderr - testsuite/tests/parser/should_compile/DumpParsedAst.stderr - testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr - testsuite/tests/parser/should_compile/DumpRenamedAst.stderr - testsuite/tests/parser/should_compile/DumpSemis.hs - testsuite/tests/parser/should_compile/DumpSemis.stderr - testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr - testsuite/tests/parser/should_compile/KindSigs.stderr - testsuite/tests/parser/should_compile/T14189.stderr - testsuite/tests/parser/should_compile/T15279.stderr - testsuite/tests/parser/should_compile/T15323.stderr - testsuite/tests/parser/should_compile/T20452.stderr - testsuite/tests/parser/should_compile/T20718.stderr - testsuite/tests/parser/should_compile/T20718b.stderr - testsuite/tests/parser/should_compile/T20846.stderr - testsuite/tests/parser/should_compile/T23315/T23315.stderr - testsuite/tests/perf/compiler/all.T - testsuite/tests/perf/compiler/hard_hole_fits.stderr - testsuite/tests/printer/AnnotationNoListTuplePuns.stdout - + testsuite/tests/printer/Haddock1.hs - + testsuite/tests/printer/Layout.hs - testsuite/tests/printer/Makefile - testsuite/tests/printer/T18791.stderr - + testsuite/tests/printer/Test20297.expected.hs - testsuite/tests/printer/Test20297.hs - testsuite/tests/printer/Test20297.stdout - + testsuite/tests/printer/Test20297MD.stdout - testsuite/tests/printer/Test24533.stdout - testsuite/tests/printer/all.T - utils/check-exact/ExactPrint.hs - utils/check-exact/Main.hs - utils/check-exact/Parsers.hs - utils/check-exact/Transform.hs - utils/check-exact/Utils.hs - utils/ghc-toolchain/src/GHC/Toolchain/Target.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.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/Interface/Rename.hs - utils/haddock/haddock-api/src/Haddock/Types.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e6ce637d941d9ba727dd5c8e7568606... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e6ce637d941d9ba727dd5c8e7568606... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help