[commit: ghc] wip/nfs-locking: Generalise run and terseRun. (5596b04)

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


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

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

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

commit 5596b04183c7c55c88c4173d5143803cd93691a4
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Thu Jan 15 02:05:49 2015 +0000

    Generalise run and terseRun.


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

5596b04183c7c55c88c4173d5143803cd93691a4
 src/Oracles/Builder.hs | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/Oracles/Builder.hs b/src/Oracles/Builder.hs
index 0fce046..b1aca5d 100644
--- a/src/Oracles/Builder.hs
+++ b/src/Oracles/Builder.hs
@@ -95,27 +95,27 @@ with builder = do
 
 -- Run the builder with a given collection of arguments
 -- Raises an error if the builder is not uniquely specified in config files
-run :: Builder -> Args -> Action ()
-run builder args = do
+run :: ShowArgs a => Builder -> a -> Action ()
+run builder as = do
     needBuilder builder
     [exe] <- showArgs builder
-    args' <- args
-    cmd [exe] args'
+    args  <- showArgs as
+    cmd [exe] args
 
 -- Run the builder with a given collection of arguments printing out a
 -- terse commentary with only 'interesting' info for the builder.
 -- Raises an error if the builder is not uniquely specified in config files
-terseRun :: Builder -> Args -> Action ()
-terseRun builder args = do
-    args' <- args
+terseRun :: ShowArgs a => Builder -> a -> Action ()
+terseRun builder as = do
+    args <- showArgs as
     putNormal $ "/--------\n| Running " ++ show builder ++ " with arguments:"
-    mapM_ (putNormal . ("|   " ++)) $ interestingInfo builder args'
+    mapM_ (putNormal . ("|   " ++)) $ interestingInfo builder args
     putNormal "\\--------"
-    quietly $ run builder args
+    quietly $ run builder as
 
 interestingInfo :: Builder -> [String] -> [String]
 interestingInfo builder ss = case builder of
-    Ar       -> prefixAndSuffix 3 1 ss
+    Ar       -> prefixAndSuffix 2 1 ss
     Ld       -> prefixAndSuffix 4 0 ss
     Ghc _    -> if head ss == "-M"
                 then prefixAndSuffix 1 1 ss



More information about the ghc-commits mailing list