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 =
-- type arguments before generating the Rep/Rep1 instance, since some
-- of the tyvars might have been instantiated when deriving.
-- 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
Gen0_ -> (tyvars, inst_args)
Gen0_ -> ([], tyvars, inst_args)
Gen1_ last_tv
-- See the "wrinkle" in
-- Note [Generating a correctly typed Rep instance]
-> ( last_tv : tyvars
, anyTypeOfKind (tyVarKind last_tv) : inst_args )
-> ( [last_tv]
, last_tv: tyvars
, mkTyVarTy last_tv : inst_args )
env = zipTyEnv env_tyvars env_inst_args
in_scope = mkInScopeSet (tyCoVarsOfTypes inst_tys)
subst = mkTvSubst in_scope env
......@@ -461,7 +462,7 @@ tc_mkRepFamInsts gk tycon inst_tys =
tvs' = scopedSort tv'
cvs' = scopedSort cv'
axiom = mkSingleCoAxiom Nominal rep_name tvs' [] cvs'
fam_tc inst_tys repTy'
fam_tc (map mkTyVarTy rep1_args ++ inst_tys) repTy'
; newFamInst SynFamilyInst axiom }
......
Markdown is supported
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