From 709c4c98fcada5b3653c8a90399f2079d9861327 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Fri, 28 Jul 2017 08:12:28 -0700 Subject: [PATCH] Use unwords and fmap instead of foldr and <> --- src/Semantic/Task.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Semantic/Task.hs b/src/Semantic/Task.hs index 789676944..cc535b954 100644 --- a/src/Semantic/Task.hs +++ b/src/Semantic/Task.hs @@ -201,7 +201,7 @@ runTaskWithOptions options task = do ReadBlobPairs source -> (either Files.readBlobPairsFromHandle (traverse (traverse (uncurry Files.readFile))) source >>= yield) `catchError` (pure . Left. displayException) WriteToOutput destination contents -> either B.hPutStr B.writeFile destination contents >>= yield WriteLog level msg pairs - | Just logLevel <- optionsLevel options, level <= logLevel -> let message = printf "%-20s %s" msg (foldr (\ a b -> uncurry (printf "%s=%s") a <> " " <> b) ("" :: String) pairs) in Time.getCurrentTime >>= atomically . writeTMQueue logQueue . Message level message >>= yield + | Just logLevel <- optionsLevel options, level <= logLevel -> let message = printf "%-20s %s" msg (unwords (uncurry (printf "%s=%s") <$> pairs)) in Time.getCurrentTime >>= atomically . writeTMQueue logQueue . Message level message >>= yield | otherwise -> pure () >>= yield Parse parser blob -> go (runParser options parser blob) >>= either (pure . Left) (either (pure . Left) yield) Decorate algebra term -> pure (decoratorWithAlgebra algebra term) >>= yield