Skip to content

Conversation

@leana8959
Copy link
Contributor

Hello, I wrote about the design and my findings during the implementation of the comment preserving parser, which is part of the exact print project funded by the Haskell Foundation.

@jappeace is there something you want me to add/modify? How should I link to my blog in the article?

I proof-read multiple times, but there might still be typos or weird formulations, do let me know and I'll fix them :)

Copy link
Contributor

@Bodigrim Bodigrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

Co-authored-by: ˌbodʲɪˈɡrʲim <[email protected]>
@jappeace
Copy link
Contributor

yes, you should link to your own article as well

@Kleidukos Kleidukos self-assigned this Dec 31, 2025
Copy link
Member

@Kleidukos Kleidukos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leana8959 Thanks a lot for this article. Some stuff to revisit, I tried to suggest fixes as much as I could, but some things like the back-and-forth between preterite and present throughout the file need your attention.

Also take a look at how the paragraphs are rendered in markdown, I noticed a lot more line breaks in the markdown than what is actually rendered. :)

This is because cabal can't do _exact printing_ yet.
Concretely this means the spaces and empty lines, comments, common stanzas, and if conditions that
you add will be lost.
Adding an exact printer will allow cabal to modify the cabal files automatically and loselessly!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Adding an exact printer will allow cabal to modify the cabal files automatically and loselessly!
Adding an exact-print parser will allow `cabal` to parse a package manifest and modify it without losing any details (_losslessly_)!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too, I meant to say modify in the sense of modifying a cabal file on disk, so it would require both exact-parse and exact-print.

@leana8959
Copy link
Contributor Author

@Kleidukos

Also take a look at how the paragraphs are rendered in markdown, I noticed a lot more line breaks in the markdown than what is actually rendered. :)

Indeed! I use hardwrap in my editor at around 100 columns, should I remove the hard breaks? I thought they are ignored by the markdown render in the end anyway and didn't pay attention to them.

@Kleidukos
Copy link
Member

@leana8959 They are all ignored by the markdown renderer, but glad to know that the lack of explicit paragraph separation is intentional then. :)

Copy link
Member

@Kleidukos Kleidukos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot @leana8959

@Kleidukos Kleidukos merged commit 39506c5 into haskell:main Jan 2, 2026
2 checks passed
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.

4 participants