Commit bfe7766a authored by Fumiaki Kinoshita's avatar Fumiaki Kinoshita 💬
Browse files

attempt to bind a type parameter for Rep1

parent 96fa2292
...@@ -444,14 +444,15 @@ tc_mkRepFamInsts gk tycon inst_tys = ...@@ -444,14 +444,15 @@ tc_mkRepFamInsts gk tycon inst_tys =
-- type arguments before generating the Rep/Rep1 instance, since some -- type arguments before generating the Rep/Rep1 instance, since some
-- of the tyvars might have been instantiated when deriving. -- of the tyvars might have been instantiated when deriving.
-- See Note [Generating a correctly typed Rep instance]. -- See Note [Generating a correctly typed Rep instance].
; let (env_tyvars, env_inst_args) ; let (rep1_args, env_tyvars, env_inst_args)
= case gk_ of = case gk_ of
Gen0_ -> (tyvars, inst_args) Gen0_ -> ([], tyvars, inst_args)
Gen1_ last_tv Gen1_ last_tv
-- See the "wrinkle" in -- See the "wrinkle" in
-- Note [Generating a correctly typed Rep instance] -- Note [Generating a correctly typed Rep instance]
-> ( last_tv : tyvars -> ( [last_tv]
, anyTypeOfKind (tyVarKind last_tv) : inst_args ) , last_tv: tyvars
, mkTyVarTy last_tv : inst_args )
env = zipTyEnv env_tyvars env_inst_args env = zipTyEnv env_tyvars env_inst_args
in_scope = mkInScopeSet (tyCoVarsOfTypes inst_tys) in_scope = mkInScopeSet (tyCoVarsOfTypes inst_tys)
subst = mkTvSubst in_scope env subst = mkTvSubst in_scope env
...@@ -461,7 +462,7 @@ tc_mkRepFamInsts gk tycon inst_tys = ...@@ -461,7 +462,7 @@ tc_mkRepFamInsts gk tycon inst_tys =
tvs' = scopedSort tv' tvs' = scopedSort tv'
cvs' = scopedSort cv' cvs' = scopedSort cv'
axiom = mkSingleCoAxiom Nominal rep_name tvs' [] cvs' axiom = mkSingleCoAxiom Nominal rep_name tvs' [] cvs'
fam_tc inst_tys repTy' fam_tc (map mkTyVarTy rep1_args ++ inst_tys) repTy'
; newFamInst SynFamilyInst axiom } ; newFamInst SynFamilyInst axiom }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment