From d78d04173296841b5949ebce640f444dcfb026f2 Mon Sep 17 00:00:00 2001 From: Manuel M T Chakravarty Date: Thu, 21 Sep 2006 16:14:00 +0000 Subject: [PATCH] Extend IfaceSyn.eqIfTc to cover type kind variants from FC --- compiler/iface/IfaceSyn.lhs | 14 ++++++++++++-- compiler/iface/IfaceType.lhs | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/compiler/iface/IfaceSyn.lhs b/compiler/iface/IfaceSyn.lhs index a4942ba..cef2bf1 100644 --- a/compiler/iface/IfaceSyn.lhs +++ b/compiler/iface/IfaceSyn.lhs @@ -39,7 +39,7 @@ import NewDemand ( StrictSig, pprIfaceStrictSig ) import TcType ( deNoteType ) import Class ( FunDep, DefMeth, pprFundeps ) import OccName ( OccName, parenSymOcc, occNameFS, - OccSet, unionOccSets, unitOccSet ) + OccSet, unionOccSets, unitOccSet, occSetElts ) import UniqFM ( UniqFM, emptyUFM, addToUFM, lookupUFM ) import Name ( Name, NamedThing(..), nameOccName, isExternalName ) import CostCentre ( CostCentre, pprCostCentreCore ) @@ -474,6 +474,11 @@ data IfaceEq | NotEqual -- Definitely different | EqBut OccSet -- The same provided these local things have not changed +instance Outputable IfaceEq where + ppr Equal = ptext SLIT("Equal") + ppr NotEqual = ptext SLIT("NotEqual") + ppr (EqBut occset) = ptext SLIT("EqBut") <+> ppr (occSetElts occset) + bool :: Bool -> IfaceEq bool True = Equal bool False = NotEqual @@ -730,7 +735,12 @@ eqIfTc IfaceBoolTc IfaceBoolTc = Equal eqIfTc IfaceListTc IfaceListTc = Equal eqIfTc IfacePArrTc IfacePArrTc = Equal eqIfTc (IfaceTupTc bx1 ar1) (IfaceTupTc bx2 ar2) = bool (bx1==bx2 && ar1==ar2) -eqIfTc _ _ = NotEqual +eqIfTc IfaceLiftedTypeKindTc IfaceLiftedTypeKindTc = Equal +eqIfTc IfaceOpenTypeKindTc IfaceOpenTypeKindTc = Equal +eqIfTc IfaceUnliftedTypeKindTc IfaceUnliftedTypeKindTc = Equal +eqIfTc IfaceUbxTupleKindTc IfaceUbxTupleKindTc = Equal +eqIfTc IfaceArgTypeKindTc IfaceArgTypeKindTc = Equal +eqIfTc _ _ = NotEqual \end{code} ----------------------------------------------------------- diff --git a/compiler/iface/IfaceType.lhs b/compiler/iface/IfaceType.lhs index 9e76cdd..63e8985 100644 --- a/compiler/iface/IfaceType.lhs +++ b/compiler/iface/IfaceType.lhs @@ -123,6 +123,8 @@ data IfacePredType -- NewTypes are handled as ordinary TyConApps type IfaceContext = [IfacePredType] +-- NB: If you add a data constructor, remember to add a case to +-- IfaceSyn.eqIfTc! data IfaceTyCon -- Abbreviations for common tycons with known names = IfaceTc IfaceExtName -- The common case | IfaceIntTc | IfaceBoolTc | IfaceCharTc -- 1.7.10.4