diff options
author | Joey Hess <joey@kitenet.net> | 2012-06-23 01:33:10 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-06-23 01:33:10 -0400 |
commit | a71e7161fc4aad9ec5dfbce219d9d25703a9e3a6 (patch) | |
tree | 60c5941346aac26b9fc5a55568db0bc2b78d868f | |
parent | 38df4ed44f8deaba50b509a36814e59cf0388425 (diff) |
golfing
-rw-r--r-- | Utility/Parallel.hs | 8 |
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) |