summaryrefslogtreecommitdiff
path: root/compiler/iface/IfaceEnv.hs
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2016-05-18 16:47:29 -0700
committerBartosz Nitka <niteria@gmail.com>2016-05-18 16:47:44 -0700
commit13e40f998e15a626a4212bde0987ddbc98b3f56f (patch)
tree866dc1b2bb993af0dc54991de2b66c119885cd07 /compiler/iface/IfaceEnv.hs
parent6282bc31808e335cd8386dd20d469bc2457f84de (diff)
downloadhaskell-13e40f998e15a626a4212bde0987ddbc98b3f56f.tar.gz
Kill varEnvElts in tcPragExpr
I had to refactor some things to take VarSet instead of [Var], but I think it's more precise this way. Test Plan: ./validate Reviewers: simonmar, simonpj, austin, bgamari, goldfire Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2227 GHC Trac Issues: #4012
Diffstat (limited to 'compiler/iface/IfaceEnv.hs')
-rw-r--r--compiler/iface/IfaceEnv.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/iface/IfaceEnv.hs b/compiler/iface/IfaceEnv.hs
index 20b497bee3..0c8d8e9767 100644
--- a/compiler/iface/IfaceEnv.hs
+++ b/compiler/iface/IfaceEnv.hs
@@ -30,8 +30,8 @@ import Var
import Name
import Avail
import Module
-import UniqFM
import FastString
+import FastStringEnv
import IfaceType
import UniqSupply
import SrcLoc
@@ -259,7 +259,7 @@ initOrigNames names = foldl extendOrigNameCache emptyModuleEnv names
tcIfaceLclId :: FastString -> IfL Id
tcIfaceLclId occ
= do { lcl <- getLclEnv
- ; case (lookupUFM (if_id_env lcl) occ) of
+ ; case (lookupFsEnv (if_id_env lcl) occ) of
Just ty_var -> return ty_var
Nothing -> failIfM (text "Iface id out of scope: " <+> ppr occ)
}
@@ -267,7 +267,7 @@ tcIfaceLclId occ
extendIfaceIdEnv :: [Id] -> IfL a -> IfL a
extendIfaceIdEnv ids thing_inside
= do { env <- getLclEnv
- ; let { id_env' = addListToUFM (if_id_env env) pairs
+ ; let { id_env' = extendFsEnvList (if_id_env env) pairs
; pairs = [(occNameFS (getOccName id), id) | id <- ids] }
; setLclEnv (env { if_id_env = id_env' }) thing_inside }
@@ -275,7 +275,7 @@ extendIfaceIdEnv ids thing_inside
tcIfaceTyVar :: FastString -> IfL TyVar
tcIfaceTyVar occ
= do { lcl <- getLclEnv
- ; case (lookupUFM (if_tv_env lcl) occ) of
+ ; case (lookupFsEnv (if_tv_env lcl) occ) of
Just ty_var -> return ty_var
Nothing -> failIfM (text "Iface type variable out of scope: " <+> ppr occ)
}
@@ -283,20 +283,20 @@ tcIfaceTyVar occ
lookupIfaceTyVar :: IfaceTvBndr -> IfL (Maybe TyVar)
lookupIfaceTyVar (occ, _)
= do { lcl <- getLclEnv
- ; return (lookupUFM (if_tv_env lcl) occ) }
+ ; return (lookupFsEnv (if_tv_env lcl) occ) }
lookupIfaceVar :: IfaceBndr -> IfL (Maybe TyCoVar)
lookupIfaceVar (IfaceIdBndr (occ, _))
= do { lcl <- getLclEnv
- ; return (lookupUFM (if_id_env lcl) occ) }
+ ; return (lookupFsEnv (if_id_env lcl) occ) }
lookupIfaceVar (IfaceTvBndr (occ, _))
= do { lcl <- getLclEnv
- ; return (lookupUFM (if_tv_env lcl) occ) }
+ ; return (lookupFsEnv (if_tv_env lcl) occ) }
extendIfaceTyVarEnv :: [TyVar] -> IfL a -> IfL a
extendIfaceTyVarEnv tyvars thing_inside
= do { env <- getLclEnv
- ; let { tv_env' = addListToUFM (if_tv_env env) pairs
+ ; let { tv_env' = extendFsEnvList (if_tv_env env) pairs
; pairs = [(occNameFS (getOccName tv), tv) | tv <- tyvars] }
; setLclEnv (env { if_tv_env = tv_env' }) thing_inside }