Implement the EmptyDataDeriving proposal
authorRyan Scott <ryan.gl.scott@gmail.com>
Thu, 2 Nov 2017 15:52:50 +0000 (11:52 -0400)
committerBen Gamari <ben@smart-cactus.org>
Thu, 2 Nov 2017 15:56:26 +0000 (11:56 -0400)
commit1317ba625d40fbd51cb0538b3fde28f412f30c01
tree6f891bba014ae2fc3e9a94c6ecdfabb021a0bbf2
parent29ae83374647e227d76acd896b89590fc15590d6
Implement the EmptyDataDeriving proposal

This implements the `EmptyDataDeriving` proposal put forth in
https://github.com/ghc-proposals/ghc-proposals/blob/dbf51608/proposals/0006-deriving-empty.rst.
This has two major changes:

* The introduction of an `EmptyDataDeriving` extension, which
  permits directly deriving `Eq`, `Ord`, `Read`, and `Show` instances
  for empty data types.
* An overhaul in the code that is emitted in derived instances for
  empty data types. To see an overview of the changes brought forth,
  refer to the changes to the 8.4.1 release notes.

Test Plan: ./validate

Reviewers: bgamari, dfeuer, austin, hvr, goldfire

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #7401, #10577, #13117

Differential Revision: https://phabricator.haskell.org/D4047
19 files changed:
compiler/main/DynFlags.hs
compiler/main/ErrUtils.hs
compiler/typecheck/TcDerivUtils.hs
compiler/typecheck/TcGenDeriv.hs
docs/users_guide/8.4.1-notes.rst
docs/users_guide/glasgow_exts.rst
libraries/base/Data/Void.hs
libraries/base/GHC/Generics.hs
libraries/ghc-boot-th/GHC/LanguageExtensions/Type.hs
testsuite/tests/deriving/should_compile/drv-empty-data.stderr
testsuite/tests/deriving/should_fail/T7401_fail.hs [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T7401_fail.stderr [new file with mode: 0644]
testsuite/tests/deriving/should_fail/all.T
testsuite/tests/deriving/should_run/T5628.stderr [deleted file]
testsuite/tests/deriving/should_run/T5628.stdout [new file with mode: 0644]
testsuite/tests/deriving/should_run/T7401.hs [new file with mode: 0644]
testsuite/tests/deriving/should_run/T7401.stdout [new file with mode: 0644]
testsuite/tests/deriving/should_run/all.T
testsuite/tests/driver/T4437.hs