Make Generic1 poly-kinded
authorRyanGlScott <ryan.gl.scott@gmail.com>
Wed, 11 May 2016 13:57:48 +0000 (15:57 +0200)
committerBen Gamari <ben@smart-cactus.org>
Thu, 12 May 2016 13:39:30 +0000 (15:39 +0200)
commitb8e2565123de45f215277e3a92fbc7ace2b8fd71
treef3373dc4a2c01a392271615084563545d1d01158
parente53f2180e89652c72e51ffa614c56294ba67cf37
Make Generic1 poly-kinded

This generalizes the `Generic1` typeclass to be of kind `k -> *`, and
this also makes the relevant datatypes and typeclasses in `GHC.Generics`
poly-kinded. If `PolyKinds` is enabled, `DeriveGeneric` derives
`Generic1` instances such that they use the most general kind possible.
Otherwise, deriving `Generic1` defaults to make an instance where the
argument is of kind `* -> *` (the current behavior).

Fixes #10604. Depends on D2117.

Test Plan: ./validate

Reviewers: kosmikus, dreixel, goldfire, austin, hvr, simonpj, bgamari

Reviewed By: simonpj, bgamari

Subscribers: thomie, ekmett

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

GHC Trac Issues: #10604
17 files changed:
compiler/typecheck/TcDeriv.hs
compiler/typecheck/TcGenGenerics.hs
docs/users_guide/glasgow_exts.rst
libraries/base/Data/Data.hs
libraries/base/GHC/Generics.hs
libraries/base/changelog.md
testsuite/tests/generics/T10604/Makefile [new file with mode: 0644]
testsuite/tests/generics/T10604/T10604_Authenticated.hs [new file with mode: 0644]
testsuite/tests/generics/T10604/T10604_bad_variable_occurrence.hs [new file with mode: 0644]
testsuite/tests/generics/T10604/T10604_bad_variable_occurrence.stderr [new file with mode: 0644]
testsuite/tests/generics/T10604/T10604_deriving.hs [new file with mode: 0644]
testsuite/tests/generics/T10604/T10604_deriving.stderr [new file with mode: 0644]
testsuite/tests/generics/T10604/T10604_no_PolyKinds.hs [new file with mode: 0644]
testsuite/tests/generics/T10604/T10604_no_PolyKinds.stderr [new file with mode: 0644]
testsuite/tests/generics/T10604/all.T [new file with mode: 0644]
testsuite/tests/perf/compiler/all.T
testsuite/tests/perf/haddock/all.T