[project @ 2000-10-16 08:24:18 by simonpj]
[ghc-hetmet.git] / ghc / compiler / basicTypes / VarSet.lhs
index cf4f5df..261426e 100644 (file)
@@ -5,7 +5,7 @@
 
 \begin{code}
 module VarSet (
-       VarSet, IdSet, TyVarSet, IdOrTyVarSet, UVarSet,
+       VarSet, IdSet, TyVarSet, UVarSet,
        emptyVarSet, unitVarSet, mkVarSet,
        extendVarSet,
        elemVarSet, varSetElems, subVarSet,
@@ -13,16 +13,14 @@ module VarSet (
        intersectVarSet, intersectsVarSet,
        isEmptyVarSet, delVarSet, delVarSetByKey,
        minusVarSet, foldVarSet, filterVarSet,
-       lookupVarSet, mapVarSet, sizeVarSet, seqVarSet,
-
-       uniqAway
+       lookupVarSet, mapVarSet, sizeVarSet, seqVarSet
     ) where
 
 #include "HsVersions.h"
 
 import CmdLineOpts     ( opt_PprStyle_Debug )
-import Var             ( Var, Id, TyVar, UVar, IdOrTyVar, setVarUnique )
-import Unique          ( Unique, Uniquable(..), incrUnique, deriveUnique )
+import Var             ( Var, Id, TyVar, UVar, setVarUnique )
+import Unique          ( Unique, Uniquable(..) )
 import UniqSet
 import UniqFM          ( delFromUFM_Directly )
 import Outputable
@@ -38,7 +36,6 @@ import Outputable
 type VarSet       = UniqSet Var
 type IdSet       = UniqSet Id
 type TyVarSet    = UniqSet TyVar
-type IdOrTyVarSet = UniqSet IdOrTyVar
 type UVarSet      = UniqSet UVar
 
 emptyVarSet    :: VarSet
@@ -92,20 +89,3 @@ seqVarSet :: VarSet -> ()
 seqVarSet s = sizeVarSet s `seq` ()
 \end{code}
 
-\begin{code}
-uniqAway :: VarSet -> Var -> Var
--- Give the Var a new unique, different to any in the VarSet
-uniqAway set var
-  | not (var `elemVarSet` set) = var   -- Nothing to do
-
-  | otherwise
-  = try 1 (deriveUnique (getUnique var) (hashUniqSet set))
-  where
-    try n uniq | uniq `elemUniqSet_Directly` set = try ((n+1)::Int) (incrUnique uniq)
-#ifdef DEBUG
-              | opt_PprStyle_Debug && n > 3
-              = pprTrace "uniqAway:" (ppr n <+> text "tries" <+> ppr var) 
-                setVarUnique var uniq
-#endif                     
-              | otherwise = setVarUnique var uniq
-\end{code}