summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-03-05 20:44:57 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-03-11 20:33:37 -0400
commita6989971379c26d8c288551d536149675e009e34 (patch)
tree3cf1f5db8494cb6408461679dc9bcd9f4d5a938d /ghc
parentbc41e47123b205a45385a3aa69de97ce22686423 (diff)
downloadhaskell-a6989971379c26d8c288551d536149675e009e34.tar.gz
Use a Set to represent Ways
Should make `member` queries faster and avoid messing up with missing `nubSort`. Metric Increase: hie002
Diffstat (limited to 'ghc')
-rw-r--r--ghc/Main.hs5
-rw-r--r--ghc/ghc-bin.cabal.in2
2 files changed, 4 insertions, 3 deletions
diff --git a/ghc/Main.hs b/ghc/Main.hs
index 4c546b3afc..1ad2a26e86 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -82,6 +82,7 @@ import Control.Monad.Trans.Class
import Control.Monad.Trans.Except (throwE, runExceptT)
import Data.Char
import Data.List ( isPrefixOf, partition, intercalate )
+import qualified Data.Set as Set
import Data.Maybe
import Prelude
@@ -349,12 +350,12 @@ checkOptions mode dflags srcs objs = do
let unknown_opts = [ f | (f@('-':_), _) <- srcs ]
when (notNull unknown_opts) (unknownFlagsErr unknown_opts)
- when (notNull (filter wayRTSOnly (ways dflags))
+ when (not (Set.null (Set.filter wayRTSOnly (ways dflags)))
&& isInterpretiveMode mode) $
hPutStrLn stderr ("Warning: -debug, -threaded and -ticky are ignored by GHCi")
-- -prof and --interactive are not a good combination
- when ((filter (not . wayRTSOnly) (ways dflags) /= hostFullWays)
+ when ((Set.filter (not . wayRTSOnly) (ways dflags) /= hostFullWays)
&& isInterpretiveMode mode
&& not (gopt Opt_ExternalInterpreter dflags)) $
do throwGhcException (UsageError
diff --git a/ghc/ghc-bin.cabal.in b/ghc/ghc-bin.cabal.in
index bc10724677..64967c174d 100644
--- a/ghc/ghc-bin.cabal.in
+++ b/ghc/ghc-bin.cabal.in
@@ -39,6 +39,7 @@ Executable ghc
directory >= 1 && < 1.4,
process >= 1 && < 1.7,
filepath >= 1 && < 1.5,
+ containers >= 0.5 && < 0.7,
transformers == 0.5.*,
ghc-boot == @ProjectVersionMunged@,
ghc == @ProjectVersionMunged@
@@ -57,7 +58,6 @@ Executable ghc
if flag(ghci)
-- NB: this is never built by the bootstrapping GHC+libraries
Build-depends:
- containers >= 0.5 && < 0.7,
deepseq == 1.4.*,
ghc-prim >= 0.5.0 && < 0.7,
ghci == @ProjectVersionMunged@,