ndmitchell / hlint

Haskell source code suggestions
Other
1.48k stars 195 forks source link

Redundant bracket granularity #1225

Closed Ptival closed 3 years ago

Ptival commented 3 years ago

While I like most hlint's suggestions, I really don't like the suggestion of turning:

function (Ctor (Rec { field })) = ...
-- into:
function (Ctor Rec { field }) = ...

or likewise

function (A { a }) (B { b }) = ...
-- into:
function A { a } B { b } = ...

I find the latter versions harder to read because I think of unparenthesized whitespaces as separating function arguments which is not the case with the named field puns syntax.

Unfortunately, I feel like my options are either to turn off all redundant bracket warnings, or live with it. Would it be conceivable/reasonable to split the redundant brackets into some sub-categories?

ndmitchell commented 3 years ago

I think it would be quite reasonable to pretend that you do need a bracket in this case - and I thought we even did in the past. So make remove redundant bracket not warn in this case.

ndmitchell commented 3 years ago

The next version of HLint won't suggest these bracket removals.