More consistent deprecation of extensions
The excellent work by @Jade on !12322 (closed) exposed some potential improvements to how deprecated extensions are managed (see in particular !12322 (diffs, comment 558389)).
-
-XNoOverlappingInstancesresults in a deprecation warning that doesn't really make sense:ghci> :set -XNoOverlappingInstances <no location info>: warning: [GHC-53692] [-Wdeprecated-flags] -XNoOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPSIt's debatable whether this should be deprecated or not. I guess it's reasonable to deprecate it since
-XOverlappingInstancesis never normally enabled and so disabling it shouldn't be necessary. But the message is misleading. -
xFlagsDepscarries only a singleDeprecatedvalue, even though it is reasonable for an extension but not its negation to be deprecated (e.g.-XDatatypeContextsis deprecated but-XNoDatatypeContextsis not, because one might reasonably want-XHaskell98 -XNoDatatypeContexts). As a consequence, spelling suggestions and tab-completion will not suggest-XNoDatatypeContexts. -
-XRank2Typesis documented as deprecated but does not raise a-Wdeprecated-flagswarning because it is treated as a synonym of-XRankNTypes(see also !12322 (diffs, comment 558390)). Perhaps-XPolymorphicComponentsshould be deprecated too. -
Perhaps
TurnOnFlagshould be a new datatype rather than reusingBool.
I'm hoping that in due course we will get a bit more clarity out of the GHC Steering Committee over which extensions should be considered deprecated. This ticket is mostly to record some things that might be worth tackling at the same time.