diff options
author | chessai <chessai1996@gmail.com> | 2018-12-26 12:12:37 -0500 |
---|---|---|
committer | Ben Gamari <ben@well-typed.com> | 2019-01-01 13:29:26 -0500 |
commit | a72ec85e8c6edb842d64dd41f3dd799a4ee462c1 (patch) | |
tree | c347c21af77836c92afcbf17f10a3e17b57a9630 /docs/users_guide/using-warnings.rst | |
parent | 374e44704b64afafc1179127e6c9c5bf1715ef39 (diff) | |
download | haskell-wip/D5451.tar.gz |
Add -Wmissing-deriving-strategieswip/D5451
Warn users when -XDerivingStrategies is enabled but not used, at each
potential use site.
add -Wmissing-deriving-strategies
Reviewers: bgamari, RyanGlScott
Subscribers: andrewthad, rwbarton, carter
GHC Trac Issues: #15798
Differential Revision: https://phabricator.haskell.org/D5451
Diffstat (limited to 'docs/users_guide/using-warnings.rst')
-rw-r--r-- | docs/users_guide/using-warnings.rst | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 6a6166bf0d..03ca184531 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -904,6 +904,27 @@ of ``-W(no-)*``. This option isn't enabled by default because it can be very noisy, and it often doesn't indicate a bug in the program. +.. ghc-flag:: -Wmissing-deriving-strategies + :shortdesc: warn when a deriving clause is missing a deriving strategy + :type: dynamic + :reverse: -Wno-missing-deriving-strategies + :category: + + :since: 8.8.1 + + The datatype below derives the ``Eq`` typeclass, but doesn't specify a + strategy. When :ghc-flag:`-Wmissing-deriving-strategies` is enabled, + the compiler will emit a warning about this. :: + + data Foo a = Foo a + deriving (Eq) + + The compiler will warn here that the deriving clause doesn't specify a + strategy. If the warning is enabled, but :extension:`DerivingStrategies` is + not enabled, the compiler will suggest turning on the + :extension:`DerivingStrategies` extension. This option is not on by default, + having to be turned on manually or with :ghc-flag:`-Weverything`. + .. ghc-flag:: -Wmissing-fields :shortdesc: warn when fields of a record are uninitialised :type: dynamic |