Skip to content

Instance deprecation implementation

This MR is an implementation of the proposal #575. With this proposal you can now add deprecation messages to instance or standalone deriving declarations, which get emitted whenever the solver solves for that instance. For example:

module A where
data T = T1 | T2

instance {-# WARNING "don't use" #-} Show T where
  show _ = "T"

deriving instance {-# DEPRECATED "deprecated" #-} Eq T

---------

module B where
import A
f :: T -> T -> String
f t1 t2
  | t1 == t2  = "equal" -- "deprecated" emitted here
  | otherwise = show t1 ++ show t2 -- "don't use" emitted here

TODO:

  • rerun the stderr for tests after incomplete record selectors are merged
  • squash commits

Merge request reports