-getLocalRules :: Module -> RuleBase -> (IdSet, -- Ids with local rules
- RuleBase) -- Non-local rules
--- Get the rules for locally-defined Ids out of the RuleBase
--- If we miss any rules for Ids defined here, then we end up
--- giving the local decl a new Unique (because the in-scope-set is the
--- same as the rule-id set), and now the binding for the class method
--- doesn't have the same Unique as the one in the Class and the tc-env
--- Example: class Foo a where
--- op :: a -> a
--- {-# RULES "op" op x = x #-}
---
--- NB we can't use isLocalId, because isLocalId isn't true of class methods.
-getLocalRules this_mod (RuleBase ids)
- = (mkVarSet local_ids, RuleBase (mkVarSet imp_ids))
- where
- (local_ids, imp_ids) = partition (idIsFrom this_mod) (varSetElems ids)
-