Implement `-Wcompat`
Currently we have only the following generic warning "levels":
-W enable normal warnings
-w disable all warnings
-Wall enable almost all warnings (details in )
It would be useful to be able to refer collectively to all currently implemented forward-compatibility warnings (e.g. about upcoming changes in base
, like -fwarn-amp
) via a symbolic -Wcompat
flag.
This way, users have more flexibility in opt-in or out of such warnings. So e.g. the following settings are possible in .cabal
files:
ghc-options: -Wall
:: enable "almost all warnings" as before. Some compatibility warnings may be part of-Wall
, some won't (yet).ghc-options: -Wall -Wcompat
:: enable "almost all warnings" as well as all currently implemented warnings. E.g. if GHC 8.0 implements-fwarn-mfp-compat
but doesn't include it in-Wall
, this gives users a way to opt in to get notified early about upcoming changes.ghc-options: -Wall -Wno-compat
:: This enables-Wall
**minus** any future-compat warnings. This is for users who want to be warned at all about any future compat warnings.ghc-options: -Wcompat
:: Of course,-W(no-)compat
can be used also w/o-Wall
, and then is equivalent to turning on/off the respective individual-fwarn-*-compat
flags.ghc-options: -Wall -Wcompat -Wno-mfp-compat
:: This would allow to acknowledge the MFP compat warnings, while enabling other future GHC compat warnings.