From 4ef8fd94b806c0a5aca027ff64323a58722db9b7 Mon Sep 17 00:00:00 2001 From: Max Bolingbroke Date: Thu, 31 Jul 2008 01:23:55 +0000 Subject: [PATCH] Document UniqSet --- compiler/utils/UniqSet.lhs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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} -- 1.7.10.4