diff --git a/src/Unused/CLI/ProgressIndicator.hs b/src/Unused/CLI/ProgressIndicator.hs index 65adda5..a18425f 100644 --- a/src/Unused/CLI/ProgressIndicator.hs +++ b/src/Unused/CLI/ProgressIndicator.hs @@ -25,6 +25,6 @@ progressWithIndicator f i terms = do printPrefix i (tid, indicator) <- start i $ length terms installChildInterruptHandler tid - mconcat <$> parallel (ioOps indicator) <* stop indicator <* stopGlobalPool + mconcat <$> parallel (ioOps indicator) <* stop indicator where ioOps i' = map (\t -> f t <* increment i') terms diff --git a/src/Unused/CLI/Util.hs b/src/Unused/CLI/Util.hs index 4182464..19bcded 100644 --- a/src/Unused/CLI/Util.hs +++ b/src/Unused/CLI/Util.hs @@ -5,6 +5,7 @@ module Unused.CLI.Util , module System.Console.ANSI ) where +import Control.Concurrent.ParallelIO import Control.Monad (void) import System.Console.ANSI import System.IO (hSetBuffering, BufferMode(NoBuffering), stdout) @@ -16,7 +17,7 @@ import System.Exit (ExitCode(ExitFailure)) withRuntime :: IO a -> IO a withRuntime a = do hSetBuffering stdout NoBuffering - withInterruptHandler $ withoutCursor a + withInterruptHandler $ withoutCursor a <* stopGlobalPool resetScreen :: IO () resetScreen = do