[commit: ghc] wip/nfs-locking: Ensure that intercalateArgs _ mempty = mempty. (9a24f38)

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


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

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

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

commit 9a24f3876e945b6927fb0df1da0b373c3c87cba2
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Wed Jan 7 01:16:43 2015 +0000

    Ensure that intercalateArgs _ mempty = mempty.


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

9a24f3876e945b6927fb0df1da0b373c3c87cba2
 src/Base.hs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/Base.hs b/src/Base.hs
index 9868528..8a98a7b 100644
--- a/src/Base.hs
+++ b/src/Base.hs
@@ -70,7 +70,9 @@ joinArgsSpaced = collect (\x y -> intercalateArgs " " $ x <> y) mempty
 intercalateArgs :: String -> Args -> Args
 intercalateArgs s as = do
     as' <- as
-    return [intercalate s as']
+    case as' of
+        []        -> mempty
+        otherwise -> return [intercalate s as']
 
 filterOut :: Args -> [String] -> Args
 filterOut as list = filter (`notElem` list) <$> as



More information about the ghc-commits mailing list