-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Useful concurrent combinators
--   
--   Various concurrent combinators
@package async-extra
@version 0.2.0.0

module Control.Concurrent.Async.Extra

-- | Span a green thread for each task, but only execute N tasks
--   concurrently.
mapConcurrentlyBounded :: Traversable t => Int -> (a -> IO b) -> t a -> IO (t b)

-- | Span a green thread for each task, but only execute N tasks
--   concurrently. Ignore the result
mapConcurrentlyBounded_ :: Traversable t => Int -> (a -> IO ()) -> t a -> IO ()

-- | Span green threads to perform N (batch size) tasks in one thread and
--   merge results using provided merge function
mapConcurrentlyBatched :: (NFData b, Foldable t) => Int -> ([[b]] -> IO r) -> (a -> IO b) -> t a -> IO r

-- | Span green threads to perform N (batch size) tasks in one thread and
--   ignore results
mapConcurrentlyBatched_ :: (Foldable t) => Int -> (a -> IO ()) -> t a -> IO ()

-- | Split input into N chunks with equal length and work on each chunk in
--   a dedicated green thread. Then merge results using provided merge
--   function
mapConcurrentlyChunks :: (NFData b, Foldable t) => Int -> ([[b]] -> IO r) -> (a -> IO b) -> t a -> IO r

-- | Split input into N chunks with equal length and work on each chunk in
--   a dedicated green thread. Ignore results
mapConcurrentlyChunks_ :: (Foldable t) => Int -> (a -> IO ()) -> t a -> IO ()

-- | Merge all chunks by combining to one list. (Equiv to <a>join</a>)
mergeConcatAll :: [[a]] -> [a]
