summaryrefslogtreecommitdiff
path: root/compiler/utils/UniqSet.lhs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-01-13 14:26:04 +0000
committerIan Lynagh <igloo@earth.li>2008-01-13 14:26:04 +0000
commiteb86321bb2895f6e5129a6260e18574f087c83e4 (patch)
tree77bd9f8e09c1ac997ef4e00c1ac68d5b9cc30cef /compiler/utils/UniqSet.lhs
parent38ac36a32032a538db346411b119c47e4019c08f (diff)
downloadhaskell-eb86321bb2895f6e5129a6260e18574f087c83e4.tar.gz
Fix warnings in utils/UniqSet
Diffstat (limited to 'compiler/utils/UniqSet.lhs')
-rw-r--r--compiler/utils/UniqSet.lhs46
1 files changed, 19 insertions, 27 deletions
diff --git a/compiler/utils/UniqSet.lhs b/compiler/utils/UniqSet.lhs
index 53a7e3ab5e..9b61454236 100644
--- a/compiler/utils/UniqSet.lhs
+++ b/compiler/utils/UniqSet.lhs
@@ -9,29 +9,21 @@ Based on @UniqFMs@ (as you would expect).
Basically, the things need to be in class @Uniquable@.
\begin{code}
-{-# OPTIONS -w #-}
--- The above warning supression flag is a temporary kludge.
--- While working on this module you are encouraged to remove it and fix
--- any warnings in the module. See
--- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
--- for details
-
module UniqSet (
- UniqSet, -- abstract type: NOT
-
- mkUniqSet, uniqSetToList, emptyUniqSet, unitUniqSet,
- addOneToUniqSet, addListToUniqSet, delOneFromUniqSet, delListFromUniqSet,
- unionUniqSets, unionManyUniqSets, minusUniqSet,
- elementOfUniqSet, mapUniqSet, intersectUniqSets,
- isEmptyUniqSet, filterUniqSet, sizeUniqSet, foldUniqSet,
- elemUniqSet_Directly, lookupUniqSet, hashUniqSet
+ UniqSet, -- abstract type: NOT
+
+ mkUniqSet, uniqSetToList, emptyUniqSet, unitUniqSet,
+ addOneToUniqSet, addListToUniqSet,
+ delOneFromUniqSet, delListFromUniqSet,
+ unionUniqSets, unionManyUniqSets, minusUniqSet,
+ elementOfUniqSet, mapUniqSet, intersectUniqSets,
+ isEmptyUniqSet, filterUniqSet, sizeUniqSet, foldUniqSet,
+ elemUniqSet_Directly, lookupUniqSet, hashUniqSet
) where
-#include "HsVersions.h"
-
-import Maybes ( maybeToBool )
+import Maybes
import UniqFM
-import Unique ( Unique, Uniquable(..) )
+import Unique
#if ! OMIT_NATIVE_CODEGEN
#define IF_NCG(a) a
@@ -41,9 +33,9 @@ import Unique ( Unique, Uniquable(..) )
\end{code}
%************************************************************************
-%* *
+%* *
\subsection{The @UniqSet@ type}
-%* *
+%* *
%************************************************************************
We use @UniqFM@, with a (@getUnique@-able) @Unique@ as ``key''
@@ -65,7 +57,7 @@ uniqSetToList :: UniqSet a -> [a]
uniqSetToList (MkUniqSet set) = eltsUFM set
foldUniqSet :: (a -> b -> b) -> b -> UniqSet a -> b
-foldUniqSet k z (MkUniqSet set) = foldUFM k z set
+foldUniqSet k z (MkUniqSet set) = foldUFM k z set
mkUniqSet :: Uniquable a => [a] -> UniqSet a
mkUniqSet xs = MkUniqSet (listToUFM [ (x, x) | x <- xs])
@@ -86,9 +78,9 @@ unionUniqSets :: UniqSet a -> UniqSet a -> UniqSet a
unionUniqSets (MkUniqSet set1) (MkUniqSet set2) = MkUniqSet (plusUFM set1 set2)
unionManyUniqSets :: [UniqSet a] -> UniqSet a
- -- = foldr unionUniqSets emptyUniqSet ss
-unionManyUniqSets [] = emptyUniqSet
-unionManyUniqSets [s] = s
+-- = foldr unionUniqSets emptyUniqSet ss
+unionManyUniqSets [] = emptyUniqSet
+unionManyUniqSets [s] = s
unionManyUniqSets (s:ss) = s `unionUniqSets` unionManyUniqSets ss
minusUniqSet :: UniqSet a -> UniqSet a -> UniqSet a
@@ -134,7 +126,7 @@ mapUniqSet f (MkUniqSet set) = MkUniqSet (mapUFM f set)
{- SPECIALIZE
elementOfUniqSet :: Name -> UniqSet Name -> Bool
- , Unique -> UniqSet Unique -> Bool
+ , Unique -> UniqSet Unique -> Bool
-}
{- SPECIALIZE
mkUniqSet :: [Name] -> UniqSet Name
@@ -142,7 +134,7 @@ mapUniqSet f (MkUniqSet set) = MkUniqSet (mapUFM f set)
{- SPECIALIZE
unitUniqSet :: Name -> UniqSet Name
- , Unique -> UniqSet Unique
+ , Unique -> UniqSet Unique
-}
#endif
\end{code}