Implement deriving strategies
authorRyan Scott <ryan.gl.scott@gmail.com>
Sat, 1 Oct 2016 00:15:25 +0000 (20:15 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sat, 1 Oct 2016 03:23:44 +0000 (23:23 -0400)
commit9e862765ffe161da8a4fd9cd67b0a600874feaa9
tree235c1ba702b0101e1fa6a8fe7f8146e2c7ec9c69
parentb3d55e20d20344bfc09f4ca4a554a819c4ecbfa8
Implement deriving strategies

Allows users to explicitly request which approach to `deriving` to use
via keywords, e.g.,

```
newtype Foo = Foo Bar
  deriving Eq
  deriving stock    Ord
  deriving newtype Show
```

Fixes #10598. Updates haddock submodule.

Test Plan: ./validate

Reviewers: hvr, kosmikus, goldfire, alanz, bgamari, simonpj, austin,
erikd, simonmar

Reviewed By: alanz, bgamari, simonpj

Subscribers: thomie, mpickering, oerjan

Differential Revision: https://phabricator.haskell.org/D2280

GHC Trac Issues: #10598
68 files changed:
compiler/basicTypes/BasicTypes.hs
compiler/deSugar/DsMeta.hs
compiler/hsSyn/Convert.hs
compiler/hsSyn/HsDecls.hs
compiler/main/DynFlags.hs
compiler/main/HscStats.hs
compiler/parser/ApiAnnotation.hs
compiler/parser/Lexer.x
compiler/parser/Parser.y
compiler/prelude/THNames.hs
compiler/rename/RnSource.hs
compiler/rename/RnTypes.hs
compiler/typecheck/TcDeriv.hs
compiler/typecheck/TcGenDeriv.hs
compiler/typecheck/TcInstDcls.hs
docs/users_guide/8.2.1-notes.rst
docs/users_guide/glasgow_exts.rst
docs/users_guide/safe_haskell.rst
libraries/ghc-boot-th/GHC/LanguageExtensions/Type.hs
libraries/ghci/GHCi/TH/Binary.hs
libraries/template-haskell/Language/Haskell/TH.hs
libraries/template-haskell/Language/Haskell/TH/Lib.hs
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
libraries/template-haskell/changelog.md
testsuite/driver/extra_files.py
testsuite/tests/deriving/should_fail/T10598_fail1.hs [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T10598_fail1.stderr [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T10598_fail2.hs [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T10598_fail2.stderr [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T10598_fail3.hs [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T10598_fail3.stderr [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T10598_fail4.hs [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T10598_fail4.stderr [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T10598_fail5.hs [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T10598_fail5.stderr [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T10598_fail6.hs [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T10598_fail6.stderr [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T3833.stderr
testsuite/tests/deriving/should_fail/T3834.stderr
testsuite/tests/deriving/should_fail/T9600.stderr
testsuite/tests/deriving/should_fail/T9968a.stderr
testsuite/tests/deriving/should_fail/all.T
testsuite/tests/deriving/should_fail/drvfail008.stderr
testsuite/tests/deriving/should_run/T10598_bug.hs [new file with mode: 0644]
testsuite/tests/deriving/should_run/T10598_bug.stdout [new file with mode: 0644]
testsuite/tests/deriving/should_run/T10598_run.hs [new file with mode: 0644]
testsuite/tests/deriving/should_run/T10598_run.stdout [new file with mode: 0644]
testsuite/tests/deriving/should_run/all.T
testsuite/tests/driver/T4437.hs
testsuite/tests/generics/T5462No1.stderr
testsuite/tests/ghc-api/annotations/Makefile
testsuite/tests/ghc-api/annotations/T10598.stdout [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/Test10598.hs [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/all.T
testsuite/tests/module/mod53.stderr
testsuite/tests/parser/should_fail/readFail039.stderr
testsuite/tests/rts/T7919A.hs
testsuite/tests/safeHaskell/ghci/p16.stderr
testsuite/tests/th/T10598_TH.hs [new file with mode: 0644]
testsuite/tests/th/T10598_TH.stderr [new file with mode: 0644]
testsuite/tests/th/T10697_sourceUtil.hs
testsuite/tests/th/T10819.hs
testsuite/tests/th/T8100.hs
testsuite/tests/th/TH_dataD1.hs
testsuite/tests/th/all.T
utils/haddock
utils/mkUserGuidePart/Options/Language.hs