X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fiface%2FIfaceSyn.lhs;h=5f9c1d88309fd7e4c1cba27323cd07aeeb1ac5e0;hp=bf620950a01c626ca105e08c95be2e1a91fe3b4b;hb=d76c18e05f6366c23144624b696a02fbaa6d26e8;hpb=a1899edb87b3192f192980f392680df05f50f104 diff --git a/compiler/iface/IfaceSyn.lhs b/compiler/iface/IfaceSyn.lhs index bf62095..5f9c1d8 100644 --- a/compiler/iface/IfaceSyn.lhs +++ b/compiler/iface/IfaceSyn.lhs @@ -87,7 +87,8 @@ data IfaceDecl -- current compilation unit ifFamInst :: Maybe -- Just _ <=> instance of fam (IfaceTyCon, -- Family tycon - [IfaceType]) -- Instance types + [IfaceType], -- Instance types + Int ) -- Unique index for naming } | IfaceSyn { ifName :: OccName, -- Type constructor @@ -283,9 +284,10 @@ pprRec isrec = ptext SLIT("RecFlag") <+> ppr isrec pprGen True = ptext SLIT("Generics: yes") pprGen False = ptext SLIT("Generics: no") -pprFamily Nothing = ptext SLIT("FamilyInstance: none") -pprFamily (Just (fam, tys)) = ptext SLIT("FamilyInstance:") <+> - ppr fam <+> hsep (map ppr tys) +pprFamily Nothing = ptext SLIT("FamilyInstance: none") +pprFamily (Just (fam, tys, index)) = ptext SLIT("FamilyInstance:") <+> + ppr fam <+> hsep (map ppr tys) <+> + brackets (ppr index) instance Outputable IfaceClassOp where ppr (IfaceClassOp n dm ty) = ppr n <+> ppr dm <+> dcolon <+> ppr ty @@ -554,10 +556,10 @@ eqIfDecl d1@(IfaceData {}) d2@(IfaceData {}) -- over the constructors (any more), but they do scope -- over the stupid context in the IfaceConDecls where - Nothing `eqIfTc_fam` Nothing = Equal - (Just (fam1, tys1)) `eqIfTc_fam` (Just (fam2, tys2)) = - fam1 `eqIfTc` fam2 &&& eqListBy eqIfType tys1 tys2 - _ `eqIfTc_fam` _ = NotEqual + Nothing `eqIfTc_fam` Nothing = Equal + (Just (fam1, tys1, co1)) `eqIfTc_fam` (Just (fam2, tys2, co2)) = + fam1 `eqIfTc` fam2 &&& eqListBy eqIfType tys1 tys2 &&& bool (co1 == co2) + _ `eqIfTc_fam` _ = NotEqual eqIfDecl d1@(IfaceSyn {}) d2@(IfaceSyn {}) = bool (ifName d1 == ifName d2) &&&