[commit: ghc] wip/nfs-locking: Use do notation to combine Rules. (b820539)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:20:13 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/b82053913f31548325da535ba769bb21aa4338ec/ghc

>---------------------------------------------------------------

commit b82053913f31548325da535ba769bb21aa4338ec
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sun Feb 14 23:34:37 2016 +0000

    Use do notation to combine Rules.


>---------------------------------------------------------------

b82053913f31548325da535ba769bb21aa4338ec
 src/Main.hs  | 14 +++++++-------
 src/Rules.hs | 18 +++++++++---------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/Main.hs b/src/Main.hs
index 5de50ad..96639d2 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -20,13 +20,13 @@ main = shakeArgsWith options CmdLineFlag.cmdFlags $ \cmdLineFlags targets -> do
                     else want targets >> withoutActions rules
   where
     rules :: Rules ()
-    rules = mconcat
-        [ Rules.Clean.cleanRules
-        , Rules.Oracles.oracleRules
-        , Rules.Selftest.selftestRules
-        , Rules.Test.testRules
-        , Rules.buildRules
-        , Rules.topLevelTargets ]
+    rules = do
+        Rules.Clean.cleanRules
+        Rules.Oracles.oracleRules
+        Rules.Selftest.selftestRules
+        Rules.Test.testRules
+        Rules.buildRules
+        Rules.topLevelTargets
     options = shakeOptions
         { shakeChange   = ChangeModtimeAndDigest
         , shakeFiles    = Base.shakeFilesPath
diff --git a/src/Rules.hs b/src/Rules.hs
index be71d2f..e817fc1 100644
--- a/src/Rules.hs
+++ b/src/Rules.hs
@@ -67,12 +67,12 @@ packageRules = do
             Rules.Register.registerPackage resources context
 
 buildRules :: Rules ()
-buildRules = mconcat
-    [ Rules.Cabal.cabalRules
-    , Rules.Generate.generateRules
-    , Rules.Generate.copyRules
-    , Rules.Gmp.gmpRules
-    , Rules.Libffi.libffiRules
-    , Rules.Perl.perlScriptRules
-    , Rules.Setup.setupRules
-    , Rules.packageRules ]
+buildRules = do
+    Rules.Cabal.cabalRules
+    Rules.Generate.generateRules
+    Rules.Generate.copyRules
+    Rules.Gmp.gmpRules
+    Rules.Libffi.libffiRules
+    Rules.Perl.perlScriptRules
+    Rules.Setup.setupRules
+    Rules.packageRules



More information about the ghc-commits mailing list