[commit: ghc] wip/nfs-locking: Simplify: Package -> TodoItem -> Rules () is a monoid! (56689f0)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:20:28 UTC 2017


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

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

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

commit 56689f0356383efb1cb285138cdd6b2a57d0fc11
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sun Jan 11 19:25:46 2015 +0000

    Simplify: Package -> TodoItem -> Rules () is a monoid!


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

56689f0356383efb1cb285138cdd6b2a57d0fc11
 src/Package.hs | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/Package.hs b/src/Package.hs
index 8f2850d..2fd10f1 100644
--- a/src/Package.hs
+++ b/src/Package.hs
@@ -11,12 +11,11 @@ import Package.Dependencies
 packages :: [Package]
 packages = [libraryPackage "deepseq" Stage1 defaultSettings]
 
--- Rule buildXY is defined in module X.Y
+-- Rule buildPackageX is defined in module Package.X
 buildPackage :: Package -> TodoItem -> Rules ()
-buildPackage pkg todoItem = do
-    buildPackageData         pkg todoItem
-    buildPackageDependencies pkg todoItem
-    buildPackageCompile      pkg todoItem
+buildPackage = buildPackageData
+            <> buildPackageDependencies
+            <> buildPackageCompile
 
 packageRules :: Rules ()
 packageRules = do



More information about the ghc-commits mailing list