tweag / ormolu

A formatter for Haskell source code
https://ormolu-live.tweag.io
Other
954 stars 83 forks source link

Preserve single line function arguments #1125

Closed brandonchinn178 closed 3 months ago

brandonchinn178 commented 3 months ago

Currently, function arguments are forced to be on multiple lines if the whole type is multiline:

foo ::
  Show a =>
  a ->
  String

This allows the arguments to stay on the same line if they were originally:

foo ::
  Show a =>
  a -> String

If the user wrote the function args on multiple lines, it will stay on multiple lines. So this change is not a breaking change for people with already formatted code

ref. https://github.com/fourmolu/fourmolu/pull/277 https://github.com/fourmolu/fourmolu/pull/410