X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FUniqSet.lhs;h=6d39e00e40b7f00d279b5c1d777122106f3b0c8b;hb=e9f9ec1e57d53b9302a395ce0d02c0fa59e28341;hp=90e0c9f40b0d465674745db2fc468c47b466b5c3;hpb=3efa0623150111e8157141441ee5571452f8e139;p=ghc-hetmet.git diff --git a/compiler/utils/UniqSet.lhs b/compiler/utils/UniqSet.lhs index 90e0c9f..6d39e00 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, @@ -22,7 +24,7 @@ module UniqSet ( ) where import Maybes -import LazyUniqFM +import UniqFM import Unique #if ! OMIT_NATIVE_CODEGEN @@ -118,8 +120,8 @@ hashUniqSet (MkUniqSet set) = hashUFM set isEmptyUniqSet :: UniqSet a -> Bool isEmptyUniqSet (MkUniqSet set) = isNullUFM set {-SLOW: sizeUFM set == 0-} -mapUniqSet :: (a -> a) -> UniqSet a -> UniqSet a - -- VERY IMPORTANT: *assumes* that the function doesn't change the unique +-- | Invariant: the mapping function doesn't change the unique +mapUniqSet :: (a -> b) -> UniqSet a -> UniqSet b mapUniqSet f (MkUniqSet set) = MkUniqSet (mapUFM f set) \end{code}