{-# WARNING #-} on typeclass instances?

I was looking to add some proper annotations to a large, evolving codebase, and find that compiler warnings are better than jira tickets AND inline todos, combined.

https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/pragmas.html#warning-and-deprecated-pragmas

One thing I’m missing is the ability to add warnings to typeclass instances. I realize these are not first-class in Haskell (unlike … Purescript?), and don’t have a precise syntax in mind.

Did anybody have a similar experience?

2 Likes

Would this be a satisfying answer? Custom type warnings by adamgundry · Pull Request #454 · ghc-proposals/ghc-proposals · GitHub

2 Likes

oh yes, I had forgotten about it. Well, that’s the ultra-advanced version of what I had in mind.