X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fiface%2FBuildTyCl.lhs;h=8093c083c11e6b364c8a65d7efd5f9fd218f789b;hp=5f23fd5fb4e5b8b8aae7533be3d0d9639de25806;hb=d76c18e05f6366c23144624b696a02fbaa6d26e8;hpb=a1899edb87b3192f192980f392680df05f50f104 diff --git a/compiler/iface/BuildTyCl.lhs b/compiler/iface/BuildTyCl.lhs index 5f23fd5..8093c08 100644 --- a/compiler/iface/BuildTyCl.lhs +++ b/compiler/iface/BuildTyCl.lhs @@ -69,7 +69,8 @@ buildAlgTyCon :: Name -> [TyVar] -> RecFlag -> Bool -- True <=> want generics functions -> Bool -- True <=> was declared in GADT syntax - -> Maybe (TyCon, [Type]) -- Just (family, tys) + -> Maybe (TyCon, [Type], + Int) -- Just (family, tys, index) -- <=> instance of `family' at `tys' -> TcRnIf m n TyCon @@ -102,20 +103,19 @@ buildAlgTyCon tc_name tvs stupid_theta rhs is_rec want_generics gadt_syn -- (3) Produce a `AlgTyConParent' value containing the parent and coercion -- information. -- - maybeComputeFamilyInfo Nothing rep_tycon = + maybeComputeFamilyInfo Nothing rep_tycon = return (tc_name, NoParentTyCon) - maybeComputeFamilyInfo (Just (family, instTys)) rep_tycon = + maybeComputeFamilyInfo (Just (family, instTys, index)) rep_tycon = do { -- (1) New, derived name for the instance tycon - ; uniq <- newUnique - ; final_name <- newImplicitBinder tc_name (mkInstTyTcOcc uniq) + ; final_name <- newImplicitBinder tc_name (mkInstTyTcOcc index) -- (2) Create the coercion. - ; co_tycon_name <- newImplicitBinder tc_name (mkInstTyCoOcc uniq) + ; co_tycon_name <- newImplicitBinder tc_name (mkInstTyCoOcc index) ; let co_tycon = mkDataInstCoercion co_tycon_name tvs family instTys rep_tycon -- (3) Produce parent information. - ; return (final_name, FamilyTyCon family instTys co_tycon) + ; return (final_name, FamilyTyCon family instTys co_tycon index) }