X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FUniqSet.lhs;h=9a0331547d7ba406beb92aaa2669f30eb2a919bd;hb=911e7de13ab1c0e5426c7f234e0c8dd29185a2ba;hp=9b6145423606eb913a4152fe604e0efda7290db7;hpb=eb86321bb2895f6e5129a6260e18574f087c83e4;p=ghc-hetmet.git diff --git a/compiler/utils/UniqSet.lhs b/compiler/utils/UniqSet.lhs index 9b61454..9a03315 100644 --- a/compiler/utils/UniqSet.lhs +++ b/compiler/utils/UniqSet.lhs @@ -13,8 +13,8 @@ module UniqSet ( UniqSet, -- abstract type: NOT mkUniqSet, uniqSetToList, emptyUniqSet, unitUniqSet, - addOneToUniqSet, addListToUniqSet, - delOneFromUniqSet, delListFromUniqSet, + addOneToUniqSet, addListToUniqSet, addOneToUniqSet_C, + delOneFromUniqSet, delListFromUniqSet, delOneFromUniqSet_Directly, unionUniqSets, unionManyUniqSets, minusUniqSet, elementOfUniqSet, mapUniqSet, intersectUniqSets, isEmptyUniqSet, filterUniqSet, sizeUniqSet, foldUniqSet, @@ -65,9 +65,17 @@ mkUniqSet xs = MkUniqSet (listToUFM [ (x, x) | x <- xs]) addOneToUniqSet :: Uniquable a => UniqSet a -> a -> UniqSet a addOneToUniqSet (MkUniqSet set) x = MkUniqSet (addToUFM set x x) +addOneToUniqSet_C :: Uniquable a + => (a -> a -> a) -> UniqSet a -> a -> UniqSet a +addOneToUniqSet_C f (MkUniqSet set) x = MkUniqSet (addToUFM_C f set x x) + delOneFromUniqSet :: Uniquable a => UniqSet a -> a -> UniqSet a delOneFromUniqSet (MkUniqSet set) x = MkUniqSet (delFromUFM set x) +delOneFromUniqSet_Directly :: Uniquable a => UniqSet a -> Unique -> UniqSet a +delOneFromUniqSet_Directly (MkUniqSet set) u + = MkUniqSet (delFromUFM_Directly set u) + delListFromUniqSet :: Uniquable a => UniqSet a -> [a] -> UniqSet a delListFromUniqSet (MkUniqSet set) xs = MkUniqSet (delListFromUFM set xs) @@ -116,7 +124,7 @@ mapUniqSet f (MkUniqSet set) = MkUniqSet (mapUFM f set) \end{code} \begin{code} -#if __GLASGOW_HASKELL__ +#ifdef __GLASGOW_HASKELL__ {-# SPECIALIZE addOneToUniqSet :: UniqSet Unique -> Unique -> UniqSet Unique #-}