Skip to content

Conversation

@zeme-wana
Copy link
Collaborator

@zeme-wana zeme-wana commented Nov 13, 2025

Our custom fork of fourmolu has the following behaviours which are different than upstream:

Multi-line Haddock has the closing -} on the last line, not on a separate newline.

{-| Make a 'NameInfo' mapping the given set of TH names to their
'GHC.TyThing's for later reference. 
-}

-->

{-| Make a 'NameInfo' mapping the given set of TH names to their
'GHC.TyThing's for later reference. -}

No space before | or ^ in multiline haddock:

{- | Make a 'NameInfo' mapping the given set of TH names to their
'GHC.TyThing's for later reference. -}

-->

{-| Make a 'NameInfo' mapping the given set of TH names to their
'GHC.TyThing's for later reference. -}

No newline between comments and haddock

-- Normally fourmolu would add a newline after this
{- | Make a 'NameInfo' mapping the given set of TH names to their
'GHC.TyThing's for later reference. -}

-->

-- Normally fourmolu would add a newline after this
{-| Make a 'NameInfo' mapping the given set of TH names to their
'GHC.TyThing's for later reference. -}

@github-actions
Copy link
Contributor

github-actions bot commented Nov 13, 2025

PR Preview Action v1.6.2

🚀 View preview at
https://IntersectMBO.github.io/plutus/pr-preview/docs/pr-7417/

Built to branch gh-pages at 2025-11-26 17:05 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link
Collaborator

@SeungheonOh SeungheonOh left a comment

Choose a reason for hiding this comment

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

Just few observations.

-- * 'FrameApplyArg': call 'computeCek' over the context extended with 'FrameApplyFun'
-- * 'FrameApplyFun': call 'applyEvaluate' to attempt to apply the function
-- stored in the frame to an argument.
--
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think {- | ... -} is better for multiline haddock.

I think haddock-style: multi-line will do this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, but note that using multi-line or multi-line-compact, the ending -} is always put on a separate newline: I'm unsure if this behaviour is preferred.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious, @SeungheonOh why do you prefer {- | ...} over --| ... for multi-line haddock? I don't have a strong opinion, but I think -- | is more common.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like it because I don't have to add -- on every newline.

@zeme-wana zeme-wana force-pushed the fourmolu-rebirth branch 2 times, most recently from e41a826 to 0272c81 Compare November 18, 2025 15:27
@zeme-wana zeme-wana marked this pull request as ready for review November 21, 2025 07:54
@basetunnel
Copy link
Collaborator

I don't have objections to using fourmolu, there's a few things that I haven't seen often, such as {- | -} for multi-line haddock and aligning let/in like this:

let ...
 in ...

@zeme-wana zeme-wana merged commit e9c420d into master Nov 27, 2025
2 of 3 checks passed
@zeme-wana zeme-wana deleted the fourmolu-rebirth branch November 27, 2025 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No Changelog Required Add this to skip the Changelog Check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants