From 1c6202dba4d31feb1a4e483df849a74f39e790e3 Mon Sep 17 00:00:00 2001 From: "Joseph C. Sible" Date: Sun, 5 Apr 2020 22:25:19 -0400 Subject: [PATCH] Avoid some awkward parentheses with forM_ --- src/ShellCheck/Formatter/TTY.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ShellCheck/Formatter/TTY.hs b/src/ShellCheck/Formatter/TTY.hs index ddf36aa..44bda1e 100644 --- a/src/ShellCheck/Formatter/TTY.hs +++ b/src/ShellCheck/Formatter/TTY.hs @@ -128,7 +128,7 @@ outputForFile color sys comments = do let lineCount = length fileLinesList let fileLines = listArray (1, lineCount) fileLinesList let groups = groupWith lineNo comments - mapM_ (\commentsForLine -> do + forM_ groups $ \commentsForLine -> do let lineNum = fromIntegral $ lineNo (head commentsForLine) let line = if lineNum < 1 || lineNum > lineCount then "" @@ -137,10 +137,9 @@ outputForFile color sys comments = do putStrLn $ color "message" $ "In " ++ fileName ++" line " ++ show lineNum ++ ":" putStrLn (color "source" line) - mapM_ (\c -> putStrLn (color (severityText c) $ cuteIndent c)) commentsForLine + forM_ commentsForLine $ \c -> putStrLn $ color (severityText c) $ cuteIndent c putStrLn "" showFixedString color commentsForLine (fromIntegral lineNum) fileLines - ) groups -- Pick out only the lines necessary to show a fix in action sliceFile :: Fix -> Array Int String -> (Fix, Array Int String)