Skip to content

Commit 38937f2

Browse files
committed
Merge pull request #2897 from Heather/patch-5
Bench.hs: use exitSuccess and forM
2 parents f2278fc + b603142 commit 38937f2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Cabal/Distribution/Simple/Bench.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ import Distribution.Simple.UserHooks ( Args )
2929
import Distribution.Simple.Utils ( die, notice, rawSystemExitCode )
3030
import Distribution.Text
3131

32-
import Control.Monad ( when, unless )
33-
import System.Exit ( ExitCode(..), exitFailure, exitWith )
32+
import Control.Monad ( when, unless, forM )
33+
import System.Exit ( ExitCode(..), exitFailure, exitSuccess )
3434
import System.Directory ( doesFileExist )
3535
import System.FilePath ( (</>), (<.>) )
3636

@@ -77,17 +77,17 @@ bench args pkg_descr lbi flags = do
7777
++ show (disp $ PD.benchmarkType bm)
7878
exitFailure
7979

80-
when (not $ PD.hasBenchmarks pkg_descr) $ do
80+
unless (PD.hasBenchmarks pkg_descr) $ do
8181
notice verbosity "Package has no benchmarks."
82-
exitWith ExitSuccess
82+
exitSuccess
8383

8484
when (PD.hasBenchmarks pkg_descr && null enabledBenchmarks) $
8585
die $ "No benchmarks enabled. Did you remember to configure with "
8686
++ "\'--enable-benchmarks\'?"
8787

8888
bmsToRun <- case benchmarkNames of
8989
[] -> return enabledBenchmarks
90-
names -> flip mapM names $ \bmName ->
90+
names -> forM names $ \bmName ->
9191
let benchmarkMap = zip enabledNames enabledBenchmarks
9292
enabledNames = map PD.benchmarkName enabledBenchmarks
9393
allNames = map PD.benchmarkName pkgBenchmarks

0 commit comments

Comments
 (0)