Skip to content

Commit

Permalink
Document the necessity of fixities.
Browse files Browse the repository at this point in the history
  • Loading branch information
csasarak committed Oct 4, 2023
1 parent 9160c76 commit 93706e5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions fourmolu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ newlines-between-decls: 1 # number of newlines between top-level declarations
single-constraint-parens: auto
let-style: inline

# The fixity of operators affects how Fourmolu formats them.
# Without this directive, we'd get really wonky corrections that would do things like turn this:
# ```
# exprA && exprB
# ```
# Into
# ```
# expr
# && exprB
# ``
# For operator heavy code, like Aeson parsers, it would be even worse than this.
# Fourmolu says that it can automatically detect fixities in most cases,
# but I had to specify these manually to get reasonable formatting.
# Docs: https://github.com/fourmolu/fourmolu#language-extensions-dependencies-and-fixities
# If you have issues with operator formatting, usually you can find the right fixity in the haddocks.
fixities:
- infixl 3 <|>
- infix 4 ==
Expand Down

0 comments on commit 93706e5

Please sign in to comment.