[commit: ghc] wip/generics-propeq-conservative: Actually parametrize the Constructor with the Datatype (79c7125)

git at git.haskell.org git at git.haskell.org
Fri Sep 19 01:56:53 UTC 2014


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

On branch  : wip/generics-propeq-conservative
Link       : http://ghc.haskell.org/trac/ghc/changeset/79c712528390bb170ea546fa8192cb6c9a0877ea/ghc

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

commit 79c712528390bb170ea546fa8192cb6c9a0877ea
Author: Gabor Greif <ggreif at gmail.com>
Date:   Wed Sep 17 06:43:21 2014 +0200

    Actually parametrize the Constructor with the Datatype


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

79c712528390bb170ea546fa8192cb6c9a0877ea
 compiler/typecheck/TcGenGenerics.lhs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/typecheck/TcGenGenerics.lhs b/compiler/typecheck/TcGenGenerics.lhs
index 1d0739e..0a71293 100644
--- a/compiler/typecheck/TcGenGenerics.lhs
+++ b/compiler/typecheck/TcGenGenerics.lhs
@@ -42,6 +42,7 @@ import BuildTyCl
 import SrcLoc
 import Bag
 import VarSet (elemVarSet)
+import Var (mkTyVar)
 import Outputable
 import FastString
 import Util
@@ -99,7 +100,7 @@ genGenericMetaTyCons tc mod =
                     newGlobalBinder mod (s_occ m n) loc
 
       let metaDTyCon  = mkTyCon [] d_name
-          metaCTyCons = map (\c_name -> mkTyConApp (mkTyCon [] c_name) [mkTyConTy metaDTyCon]) c_names
+          metaCTyCons = map (\c_name -> mkTyConApp (mkTyCon [mkTyVar undefined openTypeKind] c_name) [mkTyConTy metaDTyCon]) c_names
           metaSTyCons = map (map $ mkTyCon []) s_names
 
           metaDts = MetaTyCons metaDTyCon metaCTyCons metaSTyCons
@@ -665,7 +666,7 @@ instance Outputable MetaTyCons where
 
 metaTyCons2TyCons :: MetaTyCons -> Bag TyCon
 metaTyCons2TyCons (MetaTyCons d cty s) = listToBag (d : c ++ concat s)
-  where c = map (\(TyConApp c []) -> c) cty
+  where c = map (\(TyConApp c [_]) -> c) cty
 
 
 -- Bindings for Datatype, Constructor, and Selector instances



More information about the ghc-commits mailing list