tweag / ormolu

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

Would it be possible to normalise superfluous parentheses? #584

Closed aspiwack closed 4 years ago

aspiwack commented 4 years ago

Is your feature request related to a problem? Please describe.

I noticed that a function such as:

f :: (Monad m) => a -> m a
f = return

is formatted as itself.

The parentheses around Monad m is entirely superfluous, and a number of style guides frown on such extraneous parenthesis.

Describe the solution you'd like

Would it be possible to remove such parenthesis? I'm not sure that it's reasonable to hunt for parentheses everywhere and remove them at all cost. But Ormolu could remove them in constraint lists at least, that would be useful. We can look for more opportunities later if this proves to be a good idea.

mrkkrp commented 4 years ago

Duplicate of #264.