[commit: ghc] master: Allow deriving Generic for polykinded phantom types (4ff7413)

José Pedro Magalhães jpm at cs.uu.nl
Wed Apr 24 15:06:45 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

https://github.com/ghc/ghc/commit/4ff74138a4b6e81c5e28b0f8ad23e3ce20466566

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

commit 4ff74138a4b6e81c5e28b0f8ad23e3ce20466566
Author: Jose Pedro Magalhaes <jpm at cs.ox.ac.uk>
Date:   Wed Apr 24 13:03:55 2013 +0100

    Allow deriving Generic for polykinded phantom types

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

 compiler/typecheck/TcGenGenerics.lhs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler/typecheck/TcGenGenerics.lhs b/compiler/typecheck/TcGenGenerics.lhs
index b058c28..c737a5f 100644
--- a/compiler/typecheck/TcGenGenerics.lhs
+++ b/compiler/typecheck/TcGenGenerics.lhs
@@ -213,10 +213,10 @@ canDoGenerics tc tc_args
               (if (not (null (tyConStupidTheta tc)))
                 then (Just (tc_name <+> text "must not have a datatype context"))
                 else Nothing) :
-          -- The type should not be instantiated (see #5939)
+          -- The type arguments should not be instantiated (see #5939)
           -- Data family indices can be instantiated; the `tc_args` here are the
           -- representation tycon args
-              (if (all isTyVarTy tc_args)
+              (if (all isTyVarTy (filterOut isKindTy tc_args))
                 then Nothing
                 else Just (tc_name <+> text "must not be instantiated;" <+>
                            text "try deriving `" <> tc_name <+> tc_tys <>





More information about the ghc-commits mailing list