\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,
) where
import Maybes
-import LazyUniqFM
+import UniqFM
import Unique
#if ! OMIT_NATIVE_CODEGEN
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}