-
53eead15
by Wolfgang Jeltsch at 2026-09-24T20:12:03-04:00
Correct the documentation of `explicitUnits`
Resolves #27787.
-
35bf6f4b
by Simon Jakobi at 2026-09-24T20:12:49-04:00
Remove stale specHeader bullet from Note [Don't make fillers for constraint types]
The Note said that Specialise.specHeader also calls mkAbsentFiller.
abfc224a27c removed that call: the specialiser no longer drops dead
arguments at all, see Note [Do not drop dead args from specialisations]
in GHC.Core.Opt.Specialise.
Assisted-by: Claude Fable 5.1
-
1abef1ef
by Wolfgang Jeltsch at 2026-09-25T17:02:07-04:00
Improve the `mhu-closure` makefile
-
a79a68ea
by Wolfgang Jeltsch at 2026-09-25T17:02:07-04:00
Make `ghci-multi` hide all unneeded packages
-
d6e72450
by Wolfgang Jeltsch at 2026-09-25T17:02:07-04:00
Improve the definition of the home unit closure property
-
c9a2766d
by Wolfgang Jeltsch at 2026-09-25T17:02:07-04:00
Re-implement the home unit closure check
Compared to the previous implementation, the new one has the following
advantages:
* It is correct.
- It distinguishes between units that have the same unit ID but
different ABI hashes.
- When `-hide-all-packages` is not used, it considers as home unit
dependencies also units that are made implicitly available
because they are in the package database.
* It seems to be faster in usual settings.
- In particular, it does not have a preparation phase in which it
merges the dependency information from all home units, so that
its running time does not grow linearly with the size of the
package database in normal Cabal scenarios.
* It is (hopefully) clearer.
* It is better documented.
-
fa96acf8
by Wolfgang Jeltsch at 2026-09-25T17:02:07-04:00
Remove erroneous GHC flag in `hadrian-multi`
The flag was `-Werror=-Wno-error=incomplete-record-selectors`. Its
purpose was to permit incomplete record selectors, but because of the
illegal combination of `-Werror=` and `-Wno-error` it was ignored,
without any negative consequences.
-
9f48a5b9
by Alan Zimmerman at 2026-09-25T17:02:50-04:00
EPA: Add specific layout field to AnnList
Up to now AnnList has effectively served to represent lists of things
having layout, regardless of whether they do or not.
In Haskell, layout is optional in many places, as there is also an
alternative syntax using braces and semi-colons, which is free-form.
This commit introduces AnnListLayout, a data structure capturing this
distinction.
It is deliberately set up similarly to EpLayout, so that these two can
be merged in time.
The transition is done mechanically, where AnnListBraces is not used
yet, the original Nothing case maps to AnnListNoLayout, and the Just
case to AnnListLayout.
Later commits will fine tune these against the actual parser layout.
-
81e219fd
by Alan Zimmerman at 2026-09-27T09:57:12+01:00
EPA: Use EpaLocation in EpVirtualBraces
Haddock processing uses EpLayout.EpVirtualBraces to record the current
layout column, for allocating haddock comments correctly.
For exact printing, we need the line as well as the col, so we know
how many lines to skip when the indented code block starts.
This commit updates EpLayout.EpVirtualBraces so that it carries an
EpaLocation instead of just the Int column, to allow it to be used for
both purposes.
It is a simple mechanical change, with no other impact, but it allows
us to use EpLayout instead of AnnListLayout in AnnList, in the next
commit in this series.
-
89ff21da
by Alan Zimmerman at 2026-09-27T10:11:11+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.
-
6bc967fa
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: AnnList clean up patch for empty where clause
-
d091def3
by Alan Zimmerman at 2026-09-27T10:11:11+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
-
b4437661
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
WIP annclassdecl
-
ee3e8896
by Alan Zimmerman at 2026-09-27T10:11:11+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
-
9312f068
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Tidy up markAnnListA'
It takes an action which can modify the AnnList, but this
is never used. So remove it.
-
97f2bb65
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Use AnnList for GADT declarations
-
bf81506e
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Use AnnList in AnnClassDecl
-
f930eea8
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
MOVE EPA: Plan for Fixing AnnList Layout Properly
-
af4534ac
by Alan Zimmerman at 2026-09-27T10:11:11+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.
-
5bc8abf7
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Use AnnList in HsMultiIf
It introduces layout, capture it
-
701dbb38
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Use AnnList in DecBrl
-
b21856e1
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Replace AnnListLayout / AnnListBrackets with EpLayout
-
3d1b5cee
by Alan Zimmerman at 2026-09-27T10:11:11+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
-
517d9c62
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA some tests for layout. WIP
-
250e388f
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
MOVE: Exactprint layout scope plan. Do not commit
-
a8bda73c
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: tidy up a bit. Combine somewhere else
-
b0623353
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Introduce LayoutFrame stacks in ExactPrint state
-
0d74271f
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
Align with ghc-exactprint
-
4c71a47a
by Alan Zimmerman at 2026-09-27T10:11:11+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
-
f3198746
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
Exactprint: tidy up layout capturing
-
b01f993d
by Alan Zimmerman at 2026-09-27T10:11:11+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.
-
a462788f
by Alan Zimmerman at 2026-09-27T10:11:11+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
-
366a7f4c
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Make IPBinds LocatedA
-
859c4ead
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Make ClsInstDecl decls LocatedA
-
6333e313
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Make ClassDecls decls LocatedA
-
5f5e4bd2
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Make ClosedTypeFamily equations Located
For FamilyDecl/ClosedTypeFamily
-
ddb07ab0
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Make dd_cons located
-
90ca508c
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Make HsMultiIf options located
-
e32e1d5d
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Make DecBrl contents LocatedA
-
d48bd4ed
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Located do statements
-
5acd759a
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Print RecStmt located
-
d1d40ffb
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: HsCmdDo Located
-
a60b28fa
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
Extend Test20297 for additional occurrences
-
cef6a257
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Tweak PatSynBind location for comments
-
4d9588bc
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: WIP, add test for where ;; ValBinds
-
fc91c514
by Alan Zimmerman at 2026-09-27T10:11:11+01:00
EPA: Make EpVirtualBraces noSpanAnchor if no contents
Otherwise the vocurly is emitted at the start of the next
item parsed
Check: is this needed, or just a check for empty contents?
-
9914ff22
by Alan Zimmerman at 2026-09-27T16:09:47+01:00
EPA: Use EpNoLayout in AnnList with empty contents and no explicit braces
TODO: get rid of unused first arg to epVirtualBraces
-
c13ed1d8
by Alan Zimmerman at 2026-09-27T16:10:19+01:00
TODO: XClassDecl: remove additional EpLayout
-
fd49b138
by Alan Zimmerman at 2026-09-27T16:10:19+01:00
WIP: turn off exactprint debug printing
-
2ca50511
by Alan Zimmerman at 2026-09-27T16:10:19+01:00
EPA: Remove CanUpdateAnchorOnly
-
53f9429e
by Alan Zimmerman at 2026-09-27T16:10:19+01:00
EPA: Sync with ghc-exactprint after EPWriter -> CPS
-
eb753e22
by Alan Zimmerman at 2026-09-27T18:43:49+01:00
EPA: Fix EpVirtualBraces for HsDo
The start of layout must include the leading semi, so we comb3 to
ensure it is included if the initial stmts are empty
-
23f600c3
by Alan Zimmerman at 2026-09-27T18:45:21+01:00
Plan update DO NOT COMMIT
-
3ba8e610
by Alan Zimmerman at 2026-09-27T18:45:21+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
-
badd3010
by Alan Zimmerman at 2026-09-27T18:45:21+01:00
EPA: HsList attempt WIP
-
850a5f08
by Alan Zimmerman at 2026-09-27T18:45:21+01:00
Enable ppr test for Haddock1. It currently fails
-
f1d8367c
by Alan Zimmerman at 2026-09-27T18:45:21+01:00
WIP on removing NoEpAnn. Likely abandon
-
26d9b114
by Alan Zimmerman at 2026-09-27T18:45:21+01:00
EPA: Add an overview doc for exact printing
-
0a75a65b
by Simon Peyton Jones at 2026-09-27T18:45:21+01:00
Added an intro section