[commit: ghc] master: Allow GeneralizedNewtypeDeriving for classes with associated type families (630d881)
git at git.haskell.org
git at git.haskell.org
Sun Nov 6 14:21:09 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/630d88176e8dd3ccc269451bca8f55398ef5265c/ghc
>---------------------------------------------------------------
commit 630d88176e8dd3ccc269451bca8f55398ef5265c
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date: Sun Nov 6 09:09:36 2016 -0500
Allow GeneralizedNewtypeDeriving for classes with associated type families
Summary:
This implements the ability to derive associated type family instances
for newtypes automatically using `GeneralizedNewtypeDeriving`. Refer to the
users' guide additions for how this works; I essentially follow the pattern
laid out in https://ghc.haskell.org/trac/ghc/ticket/8165#comment:18.
Fixes #2721 and #8165.
Test Plan: ./validate
Reviewers: simonpj, goldfire, austin, bgamari
Reviewed By: simonpj
Subscribers: mpickering, thomie
Differential Revision: https://phabricator.haskell.org/D2636
GHC Trac Issues: #2721, #8165
>---------------------------------------------------------------
630d88176e8dd3ccc269451bca8f55398ef5265c
compiler/typecheck/TcDeriv.hs | 301 ++++++++++++++++-----
compiler/typecheck/TcGenDeriv.hs | 56 +++-
compiler/utils/Util.hs | 8 +
docs/users_guide/8.2.1-notes.rst | 5 +
docs/users_guide/glasgow_exts.rst | 127 +++++++++
.../{should_fail => should_compile}/T2721.hs | 2 +-
testsuite/tests/deriving/should_compile/T8165.hs | 52 ++++
testsuite/tests/deriving/should_compile/all.T | 2 +
testsuite/tests/deriving/should_fail/T2721.stderr | 6 -
testsuite/tests/deriving/should_fail/T4083.hs | 14 +
testsuite/tests/deriving/should_fail/T4083.stderr | 7 +
.../tests/deriving/should_fail/T8165_fail1.hs | 28 ++
.../tests/deriving/should_fail/T8165_fail1.stderr | 17 ++
.../tests/deriving/should_fail/T8165_fail2.hs | 9 +
.../tests/deriving/should_fail/T8165_fail2.stderr | 5 +
testsuite/tests/deriving/should_fail/all.T | 4 +-
testsuite/tests/generics/GenDerivOutput.stderr | 4 +-
testsuite/tests/generics/GenDerivOutput1_0.stderr | 4 +-
testsuite/tests/generics/GenDerivOutput1_1.stderr | 4 +-
.../tests/generics/T10604/T10604_deriving.stderr | 4 +-
20 files changed, 569 insertions(+), 90 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 630d88176e8dd3ccc269451bca8f55398ef5265c
More information about the ghc-commits
mailing list