-
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
Treat function application with final list same as final do-block #692
Comments
You might have already considered it, but you can at least avoid the line break between the function arguments using a a2 =
x "asdf" $
[ foo,
foo2
] |
hm but wouldnt that violate hlint's redundant $ rule? |
Yes, depending on your hlint configuration (I personally usually disable it). |
Copied over from fourmolu/fourmolu#46:
while the above example is exacerbated by configuring Fourmolu to use 4-space indentation, it's still an issue in plain Ormolu: f =
g
1
2
3
4
5
R
{ a = (),
b = ()
} when I think it would be better if Ormolu could do f =
g 1 2 3 4 5 R
{ a = (),
b = ()
} or even f =
g 1 2 3 4 5
R
{ a = (),
b = ()
} (which you could get with a |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@mrkkrp Any comments on this? If a PR were submitted for this, would it be accepted? Fourmolu might start moving on this if Ormolu isn't interested, but it'd be really great to avoid the divergence if possible |
@brandonchinn178 I don't really see a good reason to introduce an exception for how a multiline function application is formatted in this case. I'd value consistency more even when a list is involved. |
Is your feature request related to a problem? Please describe.
In my mind, a final do-block and a long final list should be formatted the same, something like
But ormolu currently formats the second one differently from the first (which is already formatted correctly):
This shows up a lot in tasty tests, where i'd like the format
but the
testGroup
format becomes different from thetestCase
format after ormolu:Describe the solution you'd like
Treat a long final argument the same as a do-block.
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: