diff --git a/src/Unused/CLI/ProgressIndicator.hs b/src/Unused/CLI/ProgressIndicator.hs index 71d8a6b..046a8a2 100644 --- a/src/Unused/CLI/ProgressIndicator.hs +++ b/src/Unused/CLI/ProgressIndicator.hs @@ -5,6 +5,7 @@ module Unused.CLI.ProgressIndicator , progressWithIndicator ) where +import Control.Concurrent.ParallelIO import Unused.CLI.Util import Unused.CLI.ProgressIndicator.Types import Unused.CLI.ProgressIndicator.Internal @@ -23,6 +24,6 @@ progressWithIndicator :: (a -> IO [b]) -> ProgressIndicator -> [a] -> IO [b] progressWithIndicator f i terms = do printPrefix i indicator <- start i $ length terms - concat <$> sequence (ioOps indicator) <* stop indicator + concat <$> parallel (ioOps indicator) <* stop indicator <* stopGlobalPool where ioOps i' = map (\t -> f t <* increment i') terms diff --git a/unused.cabal b/unused.cabal index cf0f7c3..4df36d0 100644 --- a/unused.cabal +++ b/unused.cabal @@ -42,6 +42,7 @@ library , terminal-progress-bar , ansi-terminal , unix + , parallel-io ghc-options: -Wall -Werror -O2 default-language: Haskell2010