Skip to content

Address substantive review comments on exact print proposal - #1

Closed
jappeace-sloth wants to merge 8 commits into
jappeace:add-exact-print-proposalfrom
jappeace-sloth:address-review-comments
Closed

Address substantive review comments on exact print proposal#1
jappeace-sloth wants to merge 8 commits into
jappeace:add-exact-print-proposalfrom
jappeace-sloth:address-review-comments

Conversation

@jappeace-sloth

@jappeace-sloth jappeace-sloth commented Apr 15, 2026

Copy link
Copy Markdown

Comments addressed:

  • Usage examples (ulysses4ever): Fixed broken code example to be parseable Haskell; added second example showing how to add an exposed module (the cabal-add / HLS use case).
  • GPD vs Field discussion (ulysses4ever): Added "Why GPD rather than Field" section explaining the design choice with three concrete reasons.
  • Technical clarity (ulysses4ever): Rewrote the barbies section with actual type definitions from the gpd-barbie branch, explaining the type machinery step by step.
  • TypeError question (ffaf1): Explained that the closed type family has exactly two equations matching the two HasAnnotation constructors, so no TypeError catch-all is needed.
  • Trees That Grow / cabal check (ffaf1): Added "Relationship to Trees That Grow" section explaining how pattern matching works, that exhaustiveness checking is preserved, and that position info is available per field.
  • Comma handling (ulysses4ever/Bodigrim earlier PRs): Added "Comma and separator handling" section with actual implementation code showing how SurroundingText trivia preserves leading/trailing comma styles.
  • Backwards compatibility (ffaf1 dev meeting): Expanded section with concrete migration path (4 categories of downstream code), what changes and what doesn't.
  • Affected downstream packages (ffaf1): Identified gtk2hs and gi-gtk as known GPD-touching packages; explained why most packages won't be affected.
  • Maintainer impact (ffaf1 dev meeting): Detailed what maintainers need to do when adding new fields (write HasAnn instance, roundtrip tests catch missing annotations).
  • TWG undefined (ffaf1, ulysses4ever): Defined acronym on first use.
  • Half-sentences / broken flow (ulysses4ever): Fixed dangling "In this," and other incomplete text.
  • HTML in markdown (ulysses4ever): Replaced <ul>/<li> with markdown list.

Test plan

  • Review the updated proposal text for accuracy against the gpd-barbie implementation
  • Verify the code examples are correct
  • Check that all review comments from the PR are addressed

🤖 Generated with Claude Code

jappeace-sloth and others added 5 commits April 15, 2026 20:34
- Fix broken code example (now parseable Haskell)
- Add second example: adding an exposed module (ulysses4ever request)
- Define TWG acronym (Technical Working Group) on first use
- Rewrite barbies section with actual code from gpd-barbie branch
- Explain type machinery: HasAnnotation kind, type families, Trivia types
- Address TypeError question: closed type family is exhaustive, no catch-all needed
- Add Trees That Grow comparison and cabal-check compatibility discussion
- Add comma/separator handling section with implementation details
- Expand backwards compatibility section with concrete migration path
- Add GPD vs Field discussion explaining why GPD was chosen
- Identify potentially affected downstream packages (gtk2hs, gi-gtk)
- Detail maintainer impact: what changes when adding new fields
- Fix dangling half-sentences and improve document flow
- Replace HTML list with markdown
- Link to gpd-barbie implementation branch

Prompt: go over the proposal review comments, list substantive unaddressed
ones, then make a PR answering them inline with the proposal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add sections addressing the deeper technical questions raised by
Bodigrim, mpickering, and ulysses4ever in the cabal issue discussion:

- Monoidal field merging: explain how PreserveGrouping distinguishes
  two separate build-depends fields from one merged field
- Spaces inside version bounds: explain recursive parameterisation of
  VersionRangeWith storing SurroundingText at each AST node
- Relationship to other lossless parsing approaches: compare with
  ruamel.yaml, rowan/Swift CST, GHC Exact Print Annotations
- Eliminating the namespace/side-table: explain how the barbies
  approach avoids the fundamental lookup ambiguity problem

Prompt: ulysses4ever refers to some of the final comments in
haskell/cabal#11227, address that as well with the barbie approach.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tested both packages against the gpd-barbie branch:
- haskell-gi (CabalHooks.hs): compiles unchanged — its GPD field
  accesses (condLibrary, condTreeData, exposedModules, libBuildInfo,
  autogenModules) all reduce to original types under HasNoAnn.
- gtk2hs (Gtk2HsSetup.hs): compiles unchanged — only uses resolved
  PackageDescription, never touches GPD directly.

Also fix code example: condTreeConstraints was removed from CondTree
on upstream master (not a barbies change). Updated the example to
modify targetBuildDepends via condTreeData/libBuildInfo instead.

Prompt: build gtk2hs/gi-gtk against gpd-barbie to test backwards
compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The barbies prototype does not roundtrip yet. Modifying FieldGrammar
to thread annotations is the hardest part; a first simple test is
expected soon.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The ZuriHac prototype bypassed FieldGrammar entirely and could
roundtrip basic files. The barbies approach integrates with
FieldGrammar via dual HasNoAnn/HasAnn instances, which is better
integrated but makes the field grammar work harder.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread proposals/exact-print.md Outdated
Comment thread proposals/exact-print.md Outdated
jappeace-sloth and others added 3 commits April 15, 2026 21:05
- Remove AttachWith and PreserveGrouping from the code listing;
  only show AnnotateWith as the core idea, mention the others in prose.
- Show the intended end state for GPD with all component fields
  parameterised (PackageDescriptionWith m, LibraryWith m, etc.),
  with a note that the current prototype only has condLibrary done.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Show the real shape: m propagates through LibraryWith -> BuildInfoWith,
not at GPD level directly. Use ... for brevity. Show the chain from
GPD to Library to BuildInfo where AnnotateWith actually appears.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The implementation will recursively parameterise PackageDescriptionWith m,
PackageFlagWith m, and annotate gpdScannedVersion at the GPD level,
not just propagate through condLibrary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jappeace jappeace closed this Apr 18, 2026
@jappeace-sloth
jappeace-sloth deleted the address-review-comments branch April 18, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants