Type-driven linting

Let’s say I want to remove the use of fromRational :: Rational -> Scientific, which is partial. Hlint can’t do it, because it doesn’t know about types. Is there maybe a GHC plugin driven linter that would be able be able to warn me about uses of this function instantiated like this?

3 Likes

I presume stan: Haskell STatic ANalyser can do it.

2 Likes

Yes, stan can do that. Have a look here for examples of similar rules: stan/src/Stan/Inspection/Partial.hs at 3bbddb044af80133ae9a1de270323f3defcc7fce · kowainik/stan · GitHub

3 Likes