ndmitchell / hlint

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

rules for (elem False) and (notElem True) #1475

Closed jvoigtlaender closed 1 year ago

jvoigtlaender commented 1 year ago

Among other things, these would allow more fusion. For example, I had a student code:

False `elem` map (...) (...)

There is no rule about elem and map, but with one of the newly proposed rules the above becomes

any not (map (...) (...))

after which https://github.com/ndmitchell/hlint/blob/23d5d2211892935167862d72905b809cc0693dad/data/hlint.yaml#L192 can fire.

ndmitchell commented 1 year ago

Thanks!