From 279cdfa494856fd0e2954d5205838baf35d0b677 Mon Sep 17 00:00:00 2001 From: Joshua Clayton Date: Thu, 26 May 2016 05:56:24 -0400 Subject: [PATCH] Be more flexible with progress indicator types --- src/Unused/CLI/ProgressIndicator.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Unused/CLI/ProgressIndicator.hs b/src/Unused/CLI/ProgressIndicator.hs index 475b28d..65adda5 100644 --- a/src/Unused/CLI/ProgressIndicator.hs +++ b/src/Unused/CLI/ProgressIndicator.hs @@ -20,11 +20,11 @@ createSpinner = snapshots = ["⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"] colors = cycle [Black, Red, Yellow, Green, Blue, Cyan, Magenta] -progressWithIndicator :: (a -> IO [b]) -> ProgressIndicator -> [a] -> IO [b] +progressWithIndicator :: Monoid b => (a -> IO b) -> ProgressIndicator -> [a] -> IO b progressWithIndicator f i terms = do printPrefix i (tid, indicator) <- start i $ length terms installChildInterruptHandler tid - concat <$> parallel (ioOps indicator) <* stop indicator <* stopGlobalPool + mconcat <$> parallel (ioOps indicator) <* stop indicator <* stopGlobalPool where ioOps i' = map (\t -> f t <* increment i') terms