Skip to content

Flag to warn when deriving strategy is not explicitly specified

In my code, I aim to always specify deriving strategies. I would like to add a flag -fwarn-unspecified-deriving that would cause a warning to be emitted when someone wrote this:

newtype Foo = Foo Int
  deriving (Show)

The user would be required to instead write:

newtype Foo = Foo Int
  deriving newtype (Show)

Or they could use stock if that was the behavior they wanted. This flag would be off by default.

Trac metadata
Trac field Value
Version 8.6.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information