summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-09-24 15:56:21 -0400
committerBen Gamari <ben@smart-cactus.org>2021-09-24 16:12:40 -0400
commitd02c95f4209d4fd4b1e22d4025294685f9418aa7 (patch)
treeee2352350b497d69a7e14f174c37c02aea9ab311
parenta753a16c6b3158f6e07245d0421667bdef91a25e (diff)
downloadhaskell-wip/drop-eltsUFM.tar.gz
compiler: occEnvElts -> nonDetOccEnvEltswip/drop-eltsUFM
-rw-r--r--compiler/GHC/HsToCore/Coverage.hs2
-rw-r--r--compiler/GHC/IfaceToCore.hs2
-rw-r--r--compiler/GHC/Rename/Utils.hs2
-rw-r--r--compiler/GHC/Tc/Module.hs4
-rw-r--r--compiler/GHC/Types/Name/Occurrence.hs6
-rw-r--r--compiler/GHC/Types/Name/Reader.hs4
6 files changed, 10 insertions, 10 deletions
diff --git a/compiler/GHC/HsToCore/Coverage.hs b/compiler/GHC/HsToCore/Coverage.hs
index a6b9944292..4320847663 100644
--- a/compiler/GHC/HsToCore/Coverage.hs
+++ b/compiler/GHC/HsToCore/Coverage.hs
@@ -1219,7 +1219,7 @@ mkTickish :: BoxLabel -> Bool -> Bool -> SrcSpan -> OccEnv Id -> [String]
-> TM CoreTickish
mkTickish boxLabel countEntries topOnly pos fvs decl_path = do
- let ids = filter (not . isUnliftedType . idType) $ occEnvElts fvs
+ let ids = filter (not . isUnliftedType . idType) $ nonDetOccEnvElts fvs
-- unlifted types cause two problems here:
-- * we can't bind them at the GHCi prompt
-- (bindLocalsAtBreakpoint already filters them out),
diff --git a/compiler/GHC/IfaceToCore.hs b/compiler/GHC/IfaceToCore.hs
index 6c3b4b2546..686a519a0c 100644
--- a/compiler/GHC/IfaceToCore.hs
+++ b/compiler/GHC/IfaceToCore.hs
@@ -404,7 +404,7 @@ typecheckIfacesForMerging mod ifaces tc_env_vars =
:: OccEnv IfaceDecl
-- TODO: change tcIfaceDecls to accept w/o Fingerprint
names_w_things <- tcIfaceDecls ignore_prags (map (\x -> (fingerprint0, x))
- (occEnvElts decl_env))
+ (nonDetOccEnvElts decl_env))
let global_type_env = mkNameEnv names_w_things
case lookupKnotVars tc_env_vars mod of
Just tc_env_var -> writeMutVar tc_env_var global_type_env
diff --git a/compiler/GHC/Rename/Utils.hs b/compiler/GHC/Rename/Utils.hs
index 37a229e203..9642617570 100644
--- a/compiler/GHC/Rename/Utils.hs
+++ b/compiler/GHC/Rename/Utils.hs
@@ -462,7 +462,7 @@ warnUnusedGRE gre@(GRE { gre_lcl = lcl, gre_imp = is })
-- names, to be used when reporting unused record fields.
mkFieldEnv :: GlobalRdrEnv -> NameEnv (FieldLabelString, Parent)
mkFieldEnv rdr_env = mkNameEnv [ (greMangledName gre, (flLabel fl, gre_par gre))
- | gres <- occEnvElts rdr_env
+ | gres <- nonDetOccEnvElts rdr_env
, gre <- gres
, Just fl <- [greFieldLabel gre]
]
diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs
index 0cd66f624b..90d9863ee0 100644
--- a/compiler/GHC/Tc/Module.hs
+++ b/compiler/GHC/Tc/Module.hs
@@ -1582,7 +1582,7 @@ tcPreludeClashWarn warnFlag name = do
-- Continue only the name is imported from Prelude
; when (importedViaPrelude name rnImports) $ do
-- Handle 2.-4.
- { rdrElts <- fmap (concat . occEnvElts . tcg_rdr_env) getGblEnv
+ { rdrElts <- fmap (concat . nonDetOccEnvElts . tcg_rdr_env) getGblEnv
; let clashes :: GlobalRdrElt -> Bool
clashes x = isLocalDef && nameClashes && isNotInProperModule
@@ -2036,7 +2036,7 @@ runTcInteractive hsc_env thing_inside
vcat [ text "ic_tythings:" <+> vcat (map ppr (ic_tythings icxt))
, text "ic_insts:" <+> vcat (map (pprBndr LetBind . instanceDFunId) ic_insts)
, text "ic_rn_gbl_env (LocalDef)" <+>
- vcat (map ppr [ local_gres | gres <- occEnvElts (ic_rn_gbl_env icxt)
+ vcat (map ppr [ local_gres | gres <- nonDetOccEnvElts (ic_rn_gbl_env icxt)
, let local_gres = filter isLocalGRE gres
, not (null local_gres) ]) ]
diff --git a/compiler/GHC/Types/Name/Occurrence.hs b/compiler/GHC/Types/Name/Occurrence.hs
index 25f0b5e681..3f886fc549 100644
--- a/compiler/GHC/Types/Name/Occurrence.hs
+++ b/compiler/GHC/Types/Name/Occurrence.hs
@@ -81,7 +81,7 @@ module GHC.Types.Name.Occurrence (
-- * The 'OccEnv' type
OccEnv, emptyOccEnv, unitOccEnv, extendOccEnv, mapOccEnv,
lookupOccEnv, mkOccEnv, mkOccEnv_C, extendOccEnvList, elemOccEnv,
- occEnvElts, foldOccEnv, plusOccEnv, plusOccEnv_C, extendOccEnv_C,
+ nonDetOccEnvElts, foldOccEnv, plusOccEnv, plusOccEnv_C, extendOccEnv_C,
extendOccEnv_Acc, filterOccEnv, delListFromOccEnv, delFromOccEnv,
alterOccEnv, pprOccEnv,
@@ -401,7 +401,7 @@ mkOccEnv :: [(OccName,a)] -> OccEnv a
mkOccEnv_C :: (a -> a -> a) -> [(OccName,a)] -> OccEnv a
elemOccEnv :: OccName -> OccEnv a -> Bool
foldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b
-occEnvElts :: OccEnv a -> [a]
+nonDetOccEnvElts :: OccEnv a -> [a]
extendOccEnv_C :: (a->a->a) -> OccEnv a -> OccName -> a -> OccEnv a
extendOccEnv_Acc :: (a->b->b) -> (a->b) -> OccEnv b -> OccName -> a -> OccEnv b
plusOccEnv :: OccEnv a -> OccEnv a -> OccEnv a
@@ -420,7 +420,7 @@ lookupOccEnv (A x) y = lookupUFM x y
mkOccEnv l = A $ listToUFM l
elemOccEnv x (A y) = elemUFM x y
foldOccEnv a b (A c) = foldUFM a b c
-occEnvElts (A x) = nonDetEltsUFM x
+nonDetOccEnvElts (A x) = nonDetEltsUFM x
plusOccEnv (A x) (A y) = A $ plusUFM x y
plusOccEnv_C f (A x) (A y) = A $ plusUFM_C f x y
extendOccEnv_C f (A x) y z = A $ addToUFM_C f x y z
diff --git a/compiler/GHC/Types/Name/Reader.hs b/compiler/GHC/Types/Name/Reader.hs
index b2011f3375..91563a53f8 100644
--- a/compiler/GHC/Types/Name/Reader.hs
+++ b/compiler/GHC/Types/Name/Reader.hs
@@ -428,7 +428,7 @@ elemLocalRdrEnv rdr_name (LRE { lre_env = env, lre_in_scope = ns })
Orig {} -> False
localRdrEnvElts :: LocalRdrEnv -> [Name]
-localRdrEnvElts (LRE { lre_env = env }) = occEnvElts env
+localRdrEnvElts (LRE { lre_env = env }) = nonDetOccEnvElts env
inLocalRdrEnvScope :: Name -> LocalRdrEnv -> Bool
-- This is the point of the NameSet
@@ -818,7 +818,7 @@ pprGlobalRdrEnv :: Bool -> GlobalRdrEnv -> SDoc
pprGlobalRdrEnv locals_only env
= vcat [ text "GlobalRdrEnv" <+> ppWhen locals_only (text "(locals only)")
<+> lbrace
- , nest 2 (vcat [ pp (remove_locals gre_list) | gre_list <- occEnvElts env ]
+ , nest 2 (vcat [ pp (remove_locals gre_list) | gre_list <- nonDetOccEnvElts env ]
<+> rbrace) ]
where
remove_locals gres | locals_only = filter isLocalGRE gres