[project @ 2005-02-04 13:32:28 by simonmar]
[ghc-hetmet.git] / ghc / compiler / utils / UniqSet.lhs
index 182e95c..129e333 100644 (file)
@@ -12,11 +12,11 @@ module UniqSet (
        UniqSet,    -- abstract type: NOT
 
        mkUniqSet, uniqSetToList, emptyUniqSet, unitUniqSet,
-       addOneToUniqSet, addListToUniqSet, delOneFromUniqSet,
+       addOneToUniqSet, addListToUniqSet, delOneFromUniqSet, delListFromUniqSet,
        unionUniqSets, unionManyUniqSets, minusUniqSet,
        elementOfUniqSet, mapUniqSet, intersectUniqSets,
        isEmptyUniqSet, filterUniqSet, sizeUniqSet, foldUniqSet,
-       elemUniqSet_Directly, lookupUniqSet
+       elemUniqSet_Directly, lookupUniqSet, hashUniqSet
     ) where
 
 #include "HsVersions.h"
@@ -70,6 +70,9 @@ addOneToUniqSet (MkUniqSet set) x = MkUniqSet (addToUFM set x x)
 delOneFromUniqSet :: Uniquable a => UniqSet a -> a -> UniqSet a
 delOneFromUniqSet (MkUniqSet set) x = MkUniqSet (delFromUFM set x)
 
+delListFromUniqSet :: Uniquable a => UniqSet a -> [a] -> UniqSet a
+delListFromUniqSet (MkUniqSet set) xs = MkUniqSet (delListFromUFM set xs)
+
 addListToUniqSet :: Uniquable a => UniqSet a -> [a] -> UniqSet a
 addListToUniqSet (MkUniqSet set) xs = MkUniqSet (addListToUFM set [(x,x) | x<-xs])
 
@@ -103,6 +106,9 @@ elemUniqSet_Directly x (MkUniqSet set) = maybeToBool (lookupUFM_Directly set x)
 sizeUniqSet :: UniqSet a -> Int
 sizeUniqSet (MkUniqSet set) = sizeUFM set
 
+hashUniqSet :: UniqSet a -> Int
+hashUniqSet (MkUniqSet set) = hashUFM set
+
 isEmptyUniqSet :: UniqSet a -> Bool
 isEmptyUniqSet (MkUniqSet set) = isNullUFM set {-SLOW: sizeUFM set == 0-}