[commit: ghc] wip/nfs-locking: Use simpler mapM instead of traverse (73ad993)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:15:56 UTC 2017


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

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

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

commit 73ad99359cbac01618824c65fa116a46d27a4575
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sun May 22 01:57:26 2016 +0100

    Use simpler mapM instead of traverse


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

73ad99359cbac01618824c65fa116a46d27a4575
 src/Rules.hs              | 2 +-
 src/Rules/Dependencies.hs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Rules.hs b/src/Rules.hs
index e3caf6c..bea672d 100644
--- a/src/Rules.hs
+++ b/src/Rules.hs
@@ -45,7 +45,7 @@ topLevelTargets = do
                 if isLibrary pkg
                 then do -- build a library
                     ways <- interpretInContext context getLibraryWays
-                    libs <- traverse (pkgLibraryFile . Context stage pkg) ways
+                    libs <- mapM (pkgLibraryFile . Context stage pkg) ways
                     docs <- interpretInContext context buildHaddock
                     need $ libs ++ [ pkgHaddockFile context | docs && stage == Stage1 ]
                 else do -- otherwise build a program
diff --git a/src/Rules/Dependencies.hs b/src/Rules/Dependencies.hs
index 78f4d40..c5f60bb 100644
--- a/src/Rules/Dependencies.hs
+++ b/src/Rules/Dependencies.hs
@@ -36,7 +36,7 @@ buildPackageDependencies rs context at Context {..} =
             cSrcs <- pkgDataList $ CSrcs path
             let cDepFiles = map (src2dep context) cSrcs
             need $ hDepFile : cDepFiles -- need all for more parallelism
-            cDeps <- fmap concat $ traverse readFile' cDepFiles
+            cDeps <- concatMapM readFile' cDepFiles
             hDeps <- readFile' hDepFile
             let result = unlines
                        . map (\(src, deps) -> unwords $ src : deps)



More information about the ghc-commits mailing list