lots of portability changes (#1405)
[ghc-hetmet.git] / compiler / rename / RnEnv.lhs
index c5b1a8c..66177a9 100644 (file)
@@ -553,7 +553,9 @@ bindLocalFixities fixes thing_inside
         Just new_v -> returnM (Left (new_v, (FixItem (rdrNameOcc v) fix)))
         Nothing -> returnM (Right (occNameFS $ rdrNameOcc v, (L loc fix)))
 
-    nowAndLater (ls :: [Either (Name, FixItem) (FastString, Located Fixity)]) = 
+    nowAndLater :: [Either (Name, FixItem) (FastString, Located Fixity)]
+                       -> ([(Name,FixItem)], UniqFM (Located Fixity))
+    nowAndLater ls =
         foldr (\ cur -> \ (now, later) ->
                         case cur of 
                           Left (n, f) -> ((n, f) : now, later)
@@ -745,7 +747,7 @@ newLocalsRn rdr_names_w_loc
                      mkInternalName uniq (rdrNameOcc rdr_name) loc
 
 bindLocatedLocalsRn :: SDoc    -- Documentation string for error message
-                   -> [Located RdrName]
+                       -> [Located RdrName]
                    -> ([Name] -> RnM a)
                    -> RnM a
 bindLocatedLocalsRn doc_str rdr_names_w_loc enclosed_scope
@@ -756,10 +758,8 @@ bindLocatedLocalsRn doc_str rdr_names_w_loc enclosed_scope
     checkShadowing doc_str rdr_names_w_loc     `thenM_`
 
        -- Make fresh Names and extend the environment
-    newLocalsRn rdr_names_w_loc                `thenM` \ names ->
-    getLocalRdrEnv                     `thenM` \ local_env ->
-    setLocalRdrEnv (extendLocalRdrEnv local_env names)
-                  (enclosed_scope names)
+    newLocalsRn rdr_names_w_loc                `thenM` \names ->
+    bindLocalNames names (enclosed_scope names)
 
 bindLocalNames :: [Name] -> RnM a -> RnM a
 bindLocalNames names enclosed_scope