Big tidy-up of deriving code
[ghc-hetmet.git] / compiler / basicTypes / VarEnv.lhs
index e59c800..0b2553a 100644 (file)
@@ -1,7 +1,7 @@
-
+%
+% (c) The University of Glasgow 2006
 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
 %
-\section{@VarEnvs@: Variable environments}
 
 \begin{code}
 module VarEnv (
@@ -36,14 +36,14 @@ module VarEnv (
 
 #include "HsVersions.h"
 
-import OccName   ( TidyOccEnv, emptyTidyOccEnv )
-import Var       ( Var, setVarUnique )
+import OccName
+import Var
 import VarSet
 import UniqFM  
-import Unique    ( Unique, deriveUnique, getUnique )
-import Util      ( zipEqual, foldl2 )
-import Maybes    ( orElse )
-import StaticFlags( opt_PprStyle_Debug )
+import Unique
+import Util
+import Maybes
+import StaticFlags
 import Outputable
 import FastTypes
 \end{code}
@@ -231,16 +231,14 @@ rnBndrL (RV2 { envL = envL, envR = envR, in_scope = in_scope }) bL
         , envR     = envR
         , in_scope = extendInScopeSet in_scope new_b }, new_b)
   where
-    new_b | not (bL `elemInScopeSet` in_scope) = bL
-         | otherwise                          = uniqAway' in_scope bL
+    new_b = uniqAway in_scope bL
 
 rnBndrR (RV2 { envL = envL, envR = envR, in_scope = in_scope }) bR
   = (RV2 { envL     = envL
         , envR     = extendVarEnv envR bR new_b
         , in_scope = extendInScopeSet in_scope new_b }, new_b)
   where
-    new_b | not (bR `elemInScopeSet` in_scope) = bR
-         | otherwise                          = uniqAway' in_scope bR
+    new_b = uniqAway in_scope bR
 
 rnOccL, rnOccR :: RnEnv2 -> Var -> Var
 -- Look up the renaming of an occurrence in the left or right term