summaryrefslogtreecommitdiff
path: root/compiler/GHC/Rename
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2021-10-12 21:29:50 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-15 18:17:26 -0400
commitb6954f0ca8b6a4408f202405e30fea6328a68d92 (patch)
treec07ffd5784d0a809234bb3956b402aa78f37bcd3 /compiler/GHC/Rename
parentbbb1f6dab34243af0a2841164e33eec451396b3f (diff)
downloadhaskell-b6954f0ca8b6a4408f202405e30fea6328a68d92.tar.gz
shadowNames: Use OccEnv a, not [OccName]
this allows us to use a smarter implementation based on `Data.IntSet.differenceWith`, which should do less work. Also, it will unblock improvements to !6703. The `OccEnv a` really denotes a set of `OccName`s. We are not using `OccSet`, though, because that is an `OccEnv OccName`, and we in !6703 we want to use this with differently-valued `OccEnv`s. But `OccSet`s are readily and safely coerced into `OccEnv`s. There is no other use of `delLocalRdrEnvList` remaining, so removing that.
Diffstat (limited to 'compiler/GHC/Rename')
-rw-r--r--compiler/GHC/Rename/Names.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Rename/Names.hs b/compiler/GHC/Rename/Names.hs
index 9cba5f5997..7392b76c64 100644
--- a/compiler/GHC/Rename/Names.hs
+++ b/compiler/GHC/Rename/Names.hs
@@ -652,7 +652,7 @@ extendGlobalRdrEnvRn avails new_fixities
-- See Note [GlobalRdrEnv shadowing]
inBracket = isBrackStage stage
- lcl_env_TH = lcl_env { tcl_rdr = delLocalRdrEnvList (tcl_rdr lcl_env) new_occs }
+ lcl_env_TH = lcl_env { tcl_rdr = minusLocalRdrEnv (tcl_rdr lcl_env) new_occs }
-- See Note [GlobalRdrEnv shadowing]
lcl_env2 | inBracket = lcl_env_TH
@@ -677,7 +677,7 @@ extendGlobalRdrEnvRn avails new_fixities
; return (gbl_env', lcl_env3) }
where
new_names = concatMap availGreNames avails
- new_occs = map occName new_names
+ new_occs = occSetToEnv (mkOccSet (map occName new_names))
-- If there is a fixity decl for the gre, add it to the fixity env
extend_fix_env fix_env gre