[project @ 1999-07-14 14:40:20 by simonpj]
[ghc-hetmet.git] / ghc / compiler / basicTypes / VarSet.lhs
index 277c5d3..18579d3 100644 (file)
@@ -13,7 +13,7 @@ module VarSet (
        intersectVarSet, intersectsVarSet,
        isEmptyVarSet, delVarSet, delVarSetByKey,
        minusVarSet, foldVarSet, filterVarSet,
-       lookupVarSet, mapVarSet,
+       lookupVarSet, mapVarSet, sizeVarSet, seqVarSet,
 
        uniqAway
     ) where
@@ -58,6 +58,7 @@ lookupVarSet  :: VarSet -> Var -> Maybe Var
                        -- Returns the set element, which may be
                        -- (==) to the argument, but not the same as
 mapVarSet      :: (Var -> Var) -> VarSet -> VarSet
+sizeVarSet     :: VarSet -> Int
 filterVarSet   :: (Var -> Bool) -> VarSet -> VarSet
 subVarSet      :: VarSet -> VarSet -> Bool
 
@@ -79,12 +80,18 @@ mkVarSet    = mkUniqSet
 foldVarSet     = foldUniqSet
 lookupVarSet   = lookupUniqSet
 mapVarSet      = mapUniqSet
+sizeVarSet     = sizeUniqSet
 filterVarSet   = filterUniqSet
 a `subVarSet` b = isEmptyVarSet (a `minusVarSet` b)
 delVarSetByKey = delFromUFM_Directly   -- Can't be bothered to add this to UniqSet
 \end{code}
 
 \begin{code}
+seqVarSet :: VarSet -> ()
+seqVarSet s = sizeVarSet s `seq` ()
+\end{code}
+
+\begin{code}
 uniqAway :: VarSet -> Var -> Var
 -- Give the Var a new unique, different to any in the VarSet
 uniqAway set var