Monadify specialise/Specialise: use do, return, standard monad functions and MonadUnique
[ghc-hetmet.git] / compiler / iface / IfaceSyn.lhs
index 44ce235..2d650c1 100644 (file)
@@ -38,6 +38,7 @@ import IfaceType
 import NewDemand
 import Class
 import UniqFM
+import UniqSet
 import NameSet 
 import Name
 import CostCentre
@@ -244,7 +245,7 @@ data IfaceLetBndr = IfLetBndr FastString IfaceType IfaceIdInfo
 
 Note [IdInfo on nested let-bindings]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Occasionally we want to preserve IdInfo on nested let bindings The one
+Occasionally we want to preserve IdInfo on nested let bindings. The one
 that came up was a NOINLINE pragma on a let-binding inside an INLINE
 function.  The user (Duncan Coutts) really wanted the NOINLINE control
 to cross the separate compilation boundary.
@@ -412,7 +413,11 @@ ifaceDeclSubBndrs (IfaceClass {ifCtxt = sc_ctxt, ifName = cls_occ,
     dcww_occ = mkDataConWorkerOcc dc_occ
     is_newtype = n_sigs + n_ctxt == 1                  -- Sigh 
 
-ifaceDeclSubBndrs _other = []
+ifaceDeclSubBndrs (IfaceSyn {ifName = tc_occ,
+                            ifFamInst = famInst})
+  = famInstCo famInst tc_occ
+
+ifaceDeclSubBndrs _ = []
 
 -- coercion for data/newtype family instances
 famInstCo Nothing  baseOcc = []
@@ -659,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