ersatz icon indicating copy to clipboard operation
ersatz copied to clipboard

some hlint suggestions I don't agree with

Open jwaldmann opened this issue 3 years ago • 1 comments

Current CI config treats hlint warnings as errors?

I agree with most suggestions, and will apply them in my branch where I currently work, but I don't like it that

  • it wants to eta-reduce the last clause (it produces asymmetric code - that just looks ugly)
  lastAtom f = sat $ \ (SAT a b c) ->
    fmap (\a' -> SAT a' b c) (f a)
  formula f = sat $ \ (SAT a b c) ->
    fmap (\b' -> SAT a b' c) (f b)
  stableMap f = sat $ \ (SAT a b c) ->
    fmap (\c' -> SAT a b c') (f c)
  • it wants to "Move brackets to avoid $". But no! I use $ to avoid brackets!
Found:
  (Bits $ contents a) + (Bits $ contents b)
Perhaps:
  (Bits $ contents a) + Bits (contents b)

Also, for consistency: I like sum $ fmap I.size $ dimacsClauses s much better than (suggested) sum (I.size <$> dimacsClauses s)

  • it wants when (not ...) replaced by unless ... I think the first form is much clearer. The suggested form justs obfuscates the negation, and needs to be deciphered.

For reference, hlint config is at https://github.com/ekmett/ersatz/blob/master/.hlint.yaml

jwaldmann avatar Mar 16 '21 23:03 jwaldmann

I would be fine with disabling these suggestions.

RyanGlScott avatar Oct 24 '22 23:10 RyanGlScott