X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FUniqSet.lhs;h=189221111be3210103adbef912667fc808b1e5fd;hb=aedb94f5f220b5e442b23ecc445fd38c8d9b6ba0;hp=9a0331547d7ba406beb92aaa2669f30eb2a919bd;hpb=1370a4a360ec154b390c1da21d40e446739b24c8;p=ghc-hetmet.git diff --git a/compiler/utils/UniqSet.lhs b/compiler/utils/UniqSet.lhs index 9a03315..1892211 100644 --- a/compiler/utils/UniqSet.lhs +++ b/compiler/utils/UniqSet.lhs @@ -10,8 +10,10 @@ Basically, the things need to be in class @Uniquable@. \begin{code} module UniqSet ( + -- * Unique set type UniqSet, -- abstract type: NOT + -- ** Manipulating these sets mkUniqSet, uniqSetToList, emptyUniqSet, unitUniqSet, addOneToUniqSet, addListToUniqSet, addOneToUniqSet_C, delOneFromUniqSet, delListFromUniqSet, delOneFromUniqSet_Directly, @@ -118,8 +120,8 @@ hashUniqSet (MkUniqSet set) = hashUFM set isEmptyUniqSet :: UniqSet a -> Bool isEmptyUniqSet (MkUniqSet set) = isNullUFM set {-SLOW: sizeUFM set == 0-} +-- | Invariant: the mapping function doesn't change the unique mapUniqSet :: (a -> a) -> UniqSet a -> UniqSet a - -- VERY IMPORTANT: *assumes* that the function doesn't change the unique mapUniqSet f (MkUniqSet set) = MkUniqSet (mapUFM f set) \end{code}