Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fourmolu fixup #1326

Merged
merged 4 commits into from
Jul 12, 2023
Merged

Fourmolu fixup #1326

merged 4 commits into from
Jul 12, 2023

Conversation

kostmo
Copy link
Member

@kostmo kostmo commented Jun 9, 2023

Switch to fourmolu-0.13 and reformat all source code.

Closes #1328.

@restyled-io restyled-io bot mentioned this pull request Jun 9, 2023
TModule
-- ^ The elaborated + type-annotated term, plus types of any embedded definitions
-- | Requirements of the term
Copy link
Member

Choose a reason for hiding this comment

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

I think Haddock chokes on this. But once we rebase this PR on top of #1308 it should be fine.

@byorgey
Copy link
Member

byorgey commented Jul 12, 2023

I tried updating to fourmolu-0.13.0.0 but sadly it seems to make a hash of some of our parser code. It seems like it now has the wrong idea about the precedence of <|> vs other operators. For example:

-        string "0b" *> L.binary
-          <|> string "0o" *> L.octal
-          <|> string "0x" *> L.hexadecimal
-          <|> L.decimal
+        string "0b"
+          *> L.binary
+            <|> string "0o"
+          *> L.octal
+            <|> string "0x"
+          *> L.hexadecimal

@byorgey
Copy link
Member

byorgey commented Jul 12, 2023

OK, got it figured out. By reading this: fourmolu/fourmolu#345 I figured out that we just need to give fourmolu a few hints about modules that re-export other modules, so that it knows where certain operators come from (and hence what their precedence is).

@byorgey byorgey marked this pull request as ready for review July 12, 2023 12:46
@byorgey
Copy link
Member

byorgey commented Jul 12, 2023

@kostmo what do you think? I think this is ready to go. Once we rebase on top of #1367 it should build cleanly, I think.

@kostmo
Copy link
Member Author

kostmo commented Jul 12, 2023

@kostmo what do you think? I think this is ready to go. Once we rebase on top of #1367 it should build cleanly, I think.

Yes, just need your approval to merge.

@byorgey
Copy link
Member

byorgey commented Jul 12, 2023

Yes, just need your approval to merge.

Sure, since I made some changes too I wanted you to take a look. I guess I could have just approved it and then let you merge it. 😄

@byorgey byorgey added the merge me Trigger the merge process of the Pull request. label Jul 12, 2023
@mergify mergify bot merged commit 485e6ac into main Jul 12, 2023
9 checks passed
@mergify mergify bot deleted the fourmolu-fixup branch July 12, 2023 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Trigger the merge process of the Pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recommend Fourmolu v11 locally
2 participants