-
Notifications
You must be signed in to change notification settings - Fork 81
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
Formatting of long seq
(and other backticked?) chains
#1151
Comments
Thanks for opening this issue! This is a consequence of the special handling of ormolu/src/Ormolu/Printer/Operators.hs Lines 367 to 372 in 096b72d
Now I don't have a strong opinion on that; we could add a heuristic to detect |
I can see the rationale. How often is there a named function that wants special separator-style layout like |
Thoughts @mrkkrp? |
In my opinion the situation is not just about deciding which operator gets which treatment, it is even trickier. One could imagine a legitimate case where This looks natural: foo x = bar x `seq`
baz x + quux x I feel like if we want to have a good "common sense" solution we need to be able to apply 2 different formatting schemes for
I am not sure how easy this is to implement though. I think we are currently span-agnostic in the code that does operator association. |
Describe the bug
Recent versions of
ormolu
(at least 0.7.2.0, which is what my nixpkgs snapshot currently provides) seem to have changed the formatting on large chains ofseq
calls. Can you please confirm that this layout change is intentional and stable before I re-format >330amazonka-*
packages?To Reproduce
Have
ormolu
reformat the following code:Expected behavior
I expected this code to remain unchanged, but
ormolu
has decided that what it really needs is a great pyramid ofseq
calls. Note that the adjacentHashable
instance is unchanged:Additional context
amazonka-s3
service binding. Pre-generatingHashable
andNFData
instances shortens compile times vs. doing it viaGenerics
Prelude
import is an import ofAmazonka.Prelude
, which re-exports many common functions used in service bindings need. I have configured.ormolu
withmodule Amazonka.Prelude exports Prelude
so it should pick upseq
's fixity.The text was updated successfully, but these errors were encountered: