aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-06-23 01:33:10 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-06-23 01:33:10 -0400
commita71e7161fc4aad9ec5dfbce219d9d25703a9e3a6 (patch)
tree60c5941346aac26b9fc5a55568db0bc2b78d868f
parent38df4ed44f8deaba50b509a36814e59cf0388425 (diff)
golfing
-rw-r--r--Utility/Parallel.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Utility/Parallel.hs b/Utility/Parallel.hs
index a512a6d30..6e4671c05 100644
--- a/Utility/Parallel.hs
+++ b/Utility/Parallel.hs
@@ -12,9 +12,9 @@ import Common
{- Runs an action in parallel with a set of values.
- Returns values that caused the action to fail. -}
inParallel :: (v -> IO ()) -> [v] -> IO [v]
-inParallel a v = do
- pids <- mapM (forkProcess . a) v
+inParallel a l = do
+ pids <- mapM (forkProcess . a) l
statuses <- mapM (getProcessStatus True False) pids
- return $ map fst $ filter failed $ zip v statuses
+ return $ map fst $ filter (failed . snd) $ zip l statuses
where
- failed (_, status) = status /= Just (Exited ExitSuccess)
+ failed v = v /= Just (Exited ExitSuccess)