diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-09-24 15:54:29 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-09-29 09:44:40 -0400 |
commit | 7c90a1804d25c77e829546f5d744f92f3c840a77 (patch) | |
tree | 1ae086be792b95322dee65497538297b2617c84d | |
parent | 1f2ba67a07c1f94c0232952eb3af184a0962e881 (diff) | |
download | haskell-7c90a1804d25c77e829546f5d744f92f3c840a77.tar.gz |
compiler: Rename nameEnvElts -> nonDetNameEnvElts
-rw-r--r-- | compiler/GHC/Iface/Load.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Iface/Make.hs | 4 | ||||
-rw-r--r-- | compiler/GHC/IfaceToCore.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Rename/Names.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Tc/Gen/HsType.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Tc/TyCl/Utils.hs | 6 | ||||
-rw-r--r-- | compiler/GHC/Tc/Utils/Backpack.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Types/Name/Reader.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Types/Name/Shape.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Types/TypeEnv.hs | 2 |
10 files changed, 13 insertions, 13 deletions
diff --git a/compiler/GHC/Iface/Load.hs b/compiler/GHC/Iface/Load.hs index c271613b3d..eb92b881e3 100644 --- a/compiler/GHC/Iface/Load.hs +++ b/compiler/GHC/Iface/Load.hs @@ -196,7 +196,7 @@ importDecl name text "Use -ddump-if-trace to get an idea of which file caused the error"]) found_things_msg eps = hang (text "Found the following declarations in" <+> ppr (nameModule name) <> colon) - 2 (vcat (map ppr $ filter is_interesting $ nameEnvElts $ eps_PTE eps)) + 2 (vcat (map ppr $ filter is_interesting $ nonDetNameEnvElts $ eps_PTE eps)) where is_interesting thing = nameModule name == nameModule (getName thing) diff --git a/compiler/GHC/Iface/Make.hs b/compiler/GHC/Iface/Make.hs index b28e777a88..fd0516ca87 100644 --- a/compiler/GHC/Iface/Make.hs +++ b/compiler/GHC/Iface/Make.hs @@ -276,8 +276,8 @@ mkIface_ hsc_env -- See Note [Identity versus semantic module] fixities = sortBy (comparing fst) - [(occ,fix) | FixItem occ fix <- nameEnvElts fix_env] - -- The order of fixities returned from nameEnvElts is not + [(occ,fix) | FixItem occ fix <- nonDetNameEnvElts fix_env] + -- The order of fixities returned from nonDetNameEnvElts is not -- deterministic, so we sort by OccName to canonicalize it. -- See Note [Deterministic UniqFM] in GHC.Types.Unique.DFM for more details. warns = src_warns diff --git a/compiler/GHC/IfaceToCore.hs b/compiler/GHC/IfaceToCore.hs index 6806c887cc..6c3b4b2546 100644 --- a/compiler/GHC/IfaceToCore.hs +++ b/compiler/GHC/IfaceToCore.hs @@ -258,7 +258,7 @@ mergeIfaceDecl d1 d2 | isAbstractIfaceDecl d2 = d1 `withRolesFrom` d2 | IfaceClass{ ifBody = IfConcreteClass { ifSigs = ops1, ifMinDef = bf1 } } <- d1 , IfaceClass{ ifBody = IfConcreteClass { ifSigs = ops2, ifMinDef = bf2 } } <- d2 - = let ops = nameEnvElts $ + = let ops = nonDetNameEnvElts $ plusNameEnv_C mergeIfaceClassOp (mkNameEnv [ (n, op) | op@(IfaceClassOp n _ _) <- ops1 ]) (mkNameEnv [ (n, op) | op@(IfaceClassOp n _ _) <- ops2 ]) diff --git a/compiler/GHC/Rename/Names.hs b/compiler/GHC/Rename/Names.hs index 9c9781aa9d..b7826509e2 100644 --- a/compiler/GHC/Rename/Names.hs +++ b/compiler/GHC/Rename/Names.hs @@ -1190,7 +1190,7 @@ filterImports iface decl_spec (Just (want_hiding, L l import_items)) lookup_name :: IE GhcPs -> RdrName -> IELookupM (Name, AvailInfo, Maybe Name) lookup_name ie rdr | isQual rdr = failLookupWith (QualImportError rdr) - | Just succ <- mb_success = case nameEnvElts succ of + | Just succ <- mb_success = case nonDetNameEnvElts succ of -- See Note [Importing DuplicateRecordFields] [(c,a,x)] -> return (greNameMangledName c, a, x) xs -> failLookupWith (AmbiguousImport rdr (map sndOf3 xs)) diff --git a/compiler/GHC/Tc/Gen/HsType.hs b/compiler/GHC/Tc/Gen/HsType.hs index 8628f75d99..dd31ef586d 100644 --- a/compiler/GHC/Tc/Gen/HsType.hs +++ b/compiler/GHC/Tc/Gen/HsType.hs @@ -1055,7 +1055,7 @@ tc_infer_hs_type _ (XHsType ty) -- Raw uniques since we go from NameEnv to TvSubstEnv. let subst_prs :: [(Unique, TcTyVar)] subst_prs = [ (getUnique nm, tv) - | ATyVar nm tv <- nameEnvElts (tcl_env env) ] + | ATyVar nm tv <- nonDetNameEnvElts (tcl_env env) ] subst = mkTvSubst (mkInScopeSet $ mkVarSet $ map snd subst_prs) (listToUFM_Directly $ map (liftSnd mkTyVarTy) subst_prs) diff --git a/compiler/GHC/Tc/TyCl/Utils.hs b/compiler/GHC/Tc/TyCl/Utils.hs index 1cb3555f35..b7d47d57d8 100644 --- a/compiler/GHC/Tc/TyCl/Utils.hs +++ b/compiler/GHC/Tc/TyCl/Utils.hs @@ -92,11 +92,11 @@ import Control.Monad -} synonymTyConsOfType :: Type -> [TyCon] --- Does not look through type synonyms at all --- Return a list of synonym tycons +-- Does not look through type synonyms at all. +-- Returns a list of synonym tycons in nondeterministic order. -- Keep this synchronized with 'expandTypeSynonyms' synonymTyConsOfType ty - = nameEnvElts (go ty) + = nonDetNameEnvElts (go ty) where go :: Type -> NameEnv TyCon -- The NameEnv does duplicate elim go (TyConApp tc tys) = go_tc tc `plusNameEnv` go_s tys diff --git a/compiler/GHC/Tc/Utils/Backpack.hs b/compiler/GHC/Tc/Utils/Backpack.hs index a2599c3a57..bb0140d5e8 100644 --- a/compiler/GHC/Tc/Utils/Backpack.hs +++ b/compiler/GHC/Tc/Utils/Backpack.hs @@ -157,7 +157,7 @@ checkHsigIface tcg_env gr sig_iface -- have to look up the right name. sig_type_occ_env = mkOccEnv . map (\t -> (nameOccName (getName t), t)) - $ nameEnvElts sig_type_env + $ nonDetNameEnvElts sig_type_env dfun_names = map getName sig_insts check_export name -- Skip instances, we'll check them later diff --git a/compiler/GHC/Types/Name/Reader.hs b/compiler/GHC/Types/Name/Reader.hs index 98b3fa66d2..b2011f3375 100644 --- a/compiler/GHC/Types/Name/Reader.hs +++ b/compiler/GHC/Types/Name/Reader.hs @@ -760,7 +760,7 @@ greParent_maybe gre = case gre_par gre of -- uniqueness assumption. gresToAvailInfo :: [GlobalRdrElt] -> [AvailInfo] gresToAvailInfo gres - = nameEnvElts avail_env + = nonDetNameEnvElts avail_env where avail_env :: NameEnv AvailInfo -- Keyed by the parent (avail_env, _) = foldl' add (emptyNameEnv, emptyNameSet) gres diff --git a/compiler/GHC/Types/Name/Shape.hs b/compiler/GHC/Types/Name/Shape.hs index 6ea3ba3a9a..5e134001c1 100644 --- a/compiler/GHC/Types/Name/Shape.hs +++ b/compiler/GHC/Types/Name/Shape.hs @@ -212,7 +212,7 @@ setNameFieldSelector hsc_env mb_mod (FieldLabel l b has_sel sel) = do mergeAvails :: [AvailInfo] -> [AvailInfo] -> [AvailInfo] mergeAvails as1 as2 = let mkNE as = mkNameEnv [(availName a, a) | a <- as] - in nameEnvElts (plusNameEnv_C plusAvail (mkNE as1) (mkNE as2)) + in nonDetNameEnvElts (plusNameEnv_C plusAvail (mkNE as1) (mkNE as2)) {- ************************************************************************ diff --git a/compiler/GHC/Types/TypeEnv.hs b/compiler/GHC/Types/TypeEnv.hs index 1b8fcd0b35..a431c3ddfc 100644 --- a/compiler/GHC/Types/TypeEnv.hs +++ b/compiler/GHC/Types/TypeEnv.hs @@ -49,7 +49,7 @@ typeEnvClasses :: TypeEnv -> [Class] lookupTypeEnv :: TypeEnv -> Name -> Maybe TyThing emptyTypeEnv = emptyNameEnv -typeEnvElts env = nameEnvElts env +typeEnvElts env = nonDetNameEnvElts env typeEnvTyCons env = [tc | ATyCon tc <- typeEnvElts env] typeEnvCoAxioms env = [ax | ACoAxiom ax <- typeEnvElts env] typeEnvIds env = [id | AnId id <- typeEnvElts env] |