From 58d0b1faf2ea388c695fdaf55d80af9b87482572 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Fri, 4 Jan 2008 10:54:50 +0000 Subject: [PATCH] A little refactoring of GenIfaceEq to make the Outputable instance into H98 --- compiler/iface/IfaceSyn.lhs | 9 +++++---- compiler/iface/MkIface.lhs | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/compiler/iface/IfaceSyn.lhs b/compiler/iface/IfaceSyn.lhs index 8786371..2d650c1 100644 --- a/compiler/iface/IfaceSyn.lhs +++ b/compiler/iface/IfaceSyn.lhs @@ -38,6 +38,7 @@ import IfaceType import NewDemand import Class import UniqFM +import UniqSet import NameSet import Name import CostCentre @@ -663,14 +664,14 @@ Of course, equality is also done modulo alpha conversion. data GenIfaceEq a = Equal -- Definitely exactly the same | NotEqual -- Definitely different - | EqBut a -- The same provided these Names have not changed + | EqBut (UniqSet a) -- The same provided these things have not changed -type IfaceEq = GenIfaceEq NameSet +type IfaceEq = GenIfaceEq Name -instance Outputable IfaceEq where +instance Outputable a => Outputable (GenIfaceEq a) where ppr Equal = ptext SLIT("Equal") ppr NotEqual = ptext SLIT("NotEqual") - ppr (EqBut occset) = ptext SLIT("EqBut") <+> ppr (nameSetToList occset) + ppr (EqBut occset) = ptext SLIT("EqBut") <+> ppr (uniqSetToList occset) bool :: Bool -> IfaceEq bool True = Equal diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs index e569c47..80ef6d0 100644 --- a/compiler/iface/MkIface.lhs +++ b/compiler/iface/MkIface.lhs @@ -729,7 +729,7 @@ computeChangedOccs ver_fn this_module old_usages eq_info usg_modmap = listToUFM [ (usg_name usg, listToUFM (usg_entities usg)) | usg <- old_usages ] - get_local_eq_info :: GenIfaceEq NameSet -> GenIfaceEq OccSet + get_local_eq_info :: GenIfaceEq Name -> GenIfaceEq OccName get_local_eq_info Equal = Equal get_local_eq_info NotEqual = NotEqual get_local_eq_info (EqBut ns) = foldNameSet f Equal ns @@ -759,7 +759,7 @@ computeChangedOccs ver_fn this_module old_usages eq_info where (occs, iface_eqs) = unzip pairs add_changes so_far other = so_far -type OccIfaceEq = GenIfaceEq OccSet +type OccIfaceEq = GenIfaceEq OccName instance Outputable OccIfaceEq where ppr Equal = ptext SLIT("Equal") -- 1.7.10.4