[commit: ghc] ghc-8.0: Remove the instantiation check when deriving Generic(1) (a2b9c53)

git at git.haskell.org git at git.haskell.org
Sun Apr 10 22:17:13 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/a2b9c53e5e4756c23fe3d4f6f3face7ae2efafc6/ghc

>---------------------------------------------------------------

commit a2b9c53e5e4756c23fe3d4f6f3face7ae2efafc6
Author: RyanGlScott <ryan.gl.scott at gmail.com>
Date:   Sun Apr 10 22:59:37 2016 +0200

    Remove the instantiation check when deriving Generic(1)
    
    Previously, deriving `Generic(1)` bailed out when attempting to
    instantiate visible type parameters (#5939), but this instantiation
    check was quite fragile and doesn't interact well with `-XTypeInType`.
    It has been decided that `Generic(1)` shouldn't be subjected to this
    check anyway, so it has been removed, and `gen_Generic_binds`'s
    machinery has been updated to substitute the type variables in a
    generated `Rep`/`Rep1` instance with the user-supplied type arguments.
    
    In addition, this also refactors `Condition` in `TcDeriv` a bit. Namely,
    since we no longer need `tc_args` to check any conditions, the `[Type]`
    component of `Condition` has been removed.
    
    Fixes #11732.
    
    Test Plan: ./validate
    
    Reviewers: goldfire, kosmikus, simonpj, bgamari, austin
    
    Reviewed By: simonpj, bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2061
    
    GHC Trac Issues: #5939, #11732
    
    (cherry picked from commit 7443e5c8dae24b83f5f4975c7accce02b819029c)


>---------------------------------------------------------------

a2b9c53e5e4756c23fe3d4f6f3face7ae2efafc6
 compiler/typecheck/TcDeriv.hs                      |  86 +++++++---
 compiler/typecheck/TcGenGenerics.hs                | 178 ++++++++++++---------
 docs/users_guide/8.0.1-notes.rst                   |   7 +
 testsuite/tests/deriving/should_compile/T11732a.hs |  11 ++
 testsuite/tests/deriving/should_compile/T11732b.hs |  12 ++
 testsuite/tests/deriving/should_compile/T11732c.hs |  18 +++
 testsuite/tests/deriving/should_compile/T5939.hs   |  14 ++
 testsuite/tests/deriving/should_compile/all.T      |   4 +
 testsuite/tests/generics/GenCannotDoRep0_0.stderr  |  30 ++--
 9 files changed, 248 insertions(+), 112 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 a2b9c53e5e4756c23fe3d4f6f3face7ae2efafc6


More information about the ghc-commits mailing list