Have lhs/rhs match rules apply to types as well as expressions
I have file:
import Universum
import Control.Monad.Except (ExceptT)
foo :: ExceptT e m a
foo = undefined
and .hlint.yaml:
- warn: { name: "Use 'ExceptT' from Universum"
, lhs: Control.Monad.Except.ExceptT, rhs: Universum.ExceptT }
I expect hlint to tell me that I should use ExceptT from Universum as I wrote in the rules, but
$ hlint example.hs
No hints
I'm using hlint v2.0.11.
The language of expressions is really about replacing expressions, not types... I guess a subset of expressions are also valid types, and ditto patterns, so I could extend the pattern/types matcher to match on them too...
Here's another example of a very useful type hint which I'd like to have:
- warn: {lhs: a => b => c, rhs: (a, b) => c}
I think it's entirely reasonable that the {lhs: a => b => c, rhs: (a, b) => c} rule could be added as a custom rule to the internals of HLint (patch welcome!). The ExceptT one needs to have the more general mechanism though.
We'd also like this feature, primarily so we can ban Handler Value in our app and require using more specific return types. I will see if I can get some cycles devoted to it.