From bbb178f7d5248aa9eb24822c312cb6b65bac57f5 Mon Sep 17 00:00:00 2001 From: Joshua Clayton Date: Fri, 13 May 2016 14:44:03 -0400 Subject: [PATCH] Extract ioOps calculation --- src/Unused/CLI/ProgressIndicator.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Unused/CLI/ProgressIndicator.hs b/src/Unused/CLI/ProgressIndicator.hs index 0ca31f8..71d8a6b 100644 --- a/src/Unused/CLI/ProgressIndicator.hs +++ b/src/Unused/CLI/ProgressIndicator.hs @@ -23,4 +23,6 @@ progressWithIndicator :: (a -> IO [b]) -> ProgressIndicator -> [a] -> IO [b] progressWithIndicator f i terms = do printPrefix i indicator <- start i $ length terms - concat <$> mapM (\t -> f t <* increment indicator) terms <* stop indicator + concat <$> sequence (ioOps indicator) <* stop indicator + where + ioOps i' = map (\t -> f t <* increment i') terms