diff options
author | David Feuer <david.feuer@gmail.com> | 2017-03-02 13:45:27 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-03-02 14:57:30 -0500 |
commit | ae67619853d029ea8049a114f44e59f4ca10b990 (patch) | |
tree | fc4e241b74248f72ba5d9a9e438eb3bb2d84e734 /ghc | |
parent | 27a1b12f90b4b27763d22310215f0df34cbd702a (diff) | |
download | haskell-ae67619853d029ea8049a114f44e59f4ca10b990.tar.gz |
Eliminate ListSetOps from imp_trust_pkgs
Eliminate ListSetOps from imp_trust_pkgs and imp_dep_pkgs
Replace Map with NameEnv in TmOracle
Reviewers: austin, dfeuer, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D3113
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/GHCi/UI.hs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 97f47397fe..6310e3ce32 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -96,6 +96,7 @@ import Data.Function import Data.IORef ( IORef, modifyIORef, newIORef, readIORef, writeIORef ) import Data.List ( find, group, intercalate, intersperse, isPrefixOf, nub, partition, sort, sortBy ) +import qualified Data.Set as S import Data.Maybe import qualified Data.Map as M import Data.Time.LocalTime ( getZonedTime ) @@ -2042,15 +2043,15 @@ isSafeModule m = do -- print info to user... liftIO $ putStrLn $ "Trust type is (Module: " ++ trust ++ ", Package: " ++ pkg ++ ")" liftIO $ putStrLn $ "Package Trust: " ++ (if packageTrustOn dflags then "On" else "Off") - when (not $ null good) + when (not $ S.null good) (liftIO $ putStrLn $ "Trusted package dependencies (trusted): " ++ - (intercalate ", " $ map (showPpr dflags) good)) - case msafe && null bad of + (intercalate ", " $ map (showPpr dflags) (S.toList good))) + case msafe && S.null bad of True -> liftIO $ putStrLn $ mname ++ " is trusted!" False -> do when (not $ null bad) (liftIO $ putStrLn $ "Trusted package dependencies (untrusted): " - ++ (intercalate ", " $ map (showPpr dflags) bad)) + ++ (intercalate ", " $ map (showPpr dflags) (S.toList bad))) liftIO $ putStrLn $ mname ++ " is NOT trusted!" where @@ -2060,8 +2061,8 @@ isSafeModule m = do | thisPackage dflags == moduleUnitId md = True | otherwise = trusted $ getPackageDetails dflags (moduleUnitId md) - tallyPkgs dflags deps | not (packageTrustOn dflags) = ([], []) - | otherwise = partition part deps + tallyPkgs dflags deps | not (packageTrustOn dflags) = (S.empty, S.empty) + | otherwise = S.partition part deps where part pkg = trusted $ getInstalledPackageDetails dflags pkg ----------------------------------------------------------------------------- |