[commit: ghc] wip/nfs-locking: Refinements. (59a30fe)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:39:32 UTC 2017


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

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

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

commit 59a30fe3270816ca27f514a3432e941538d7dcdc
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date:   Thu Jan 14 14:19:23 2016 +0800

    Refinements.


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

59a30fe3270816ca27f514a3432e941538d7dcdc
 src/Main.hs | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/Main.hs b/src/Main.hs
index 6ec93429..14f3554 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -41,14 +41,15 @@ main = shakeArgsWith options flags $ \cmdLineFlags targets -> do
         { shakeFiles    = Base.shakeFilesPath
         , shakeProgress = progressSimple
         , shakeTimings  = True
-        , shakeOutput   = const showMsg
+        , shakeOutput   = const putMsg
         }
 
-showMsg :: String -> IO ()
-showMsg msg | dropEscSequence msg == "." = BS.putStr . UTF8.fromString $ msg
-showMsg msg | dropEscSequence msg == ""  = return ()
-showMsg msg                              = BS.putStrLn . UTF8.fromString $ msg
+-- | Dynamic switch for @putStr@ and @putStrLn@ depending on the @msg at .
+putMsg :: String -> IO ()
+putMsg msg | dropEscSequence msg == "." = BS.putStr . UTF8.fromString $ msg
+putMsg msg                              = BS.putStrLn . UTF8.fromString $ msg
 
+-- | Drops ANSI Escape sequences from a string.
 dropEscSequence :: String -> String
 dropEscSequence = go
   where



More information about the ghc-commits mailing list