diff --git a/fourmolu.yaml b/fourmolu.yaml index 6128ddf991..662d9c4306 100644 --- a/fourmolu.yaml +++ b/fourmolu.yaml @@ -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 ==