Safe Haskell | None |
---|

- data CIO r
- runCIO :: Int -> CIO r -> IO r
- runCIO' :: CIO r -> IO r
- class Monad m => MonadCIO m where
- getPoolNumCapabilities :: m Int
- sequenceConcurrently :: [m a] -> m [a]
- sequenceConcurrently' :: [m a] -> m [a]
- sequenceConcurrently_ :: [m a] -> m ()

- mapMConcurrently :: MonadCIO m => (a -> m b) -> [a] -> m [b]
- mapMConcurrently' :: MonadCIO m => (a -> m b) -> [a] -> m [b]
- mapMConcurrently_ :: MonadCIO m => (a -> m b) -> [a] -> m ()
- forMConcurrently :: MonadCIO m => [a] -> (a -> m b) -> m [b]
- forMConcurrently' :: MonadCIO m => [a] -> (a -> m b) -> m [b]
- forMConcurrently_ :: MonadCIO m => [a] -> (a -> m b) -> m ()
- distributeConcurrently :: MonadCIO m => m a -> m [a]
- distributeConcurrently_ :: MonadCIO m => m a -> m ()

# Documentation

Concurrent IO. A composable monad of IO actions executable in a shared pool of threads.

class Monad m => MonadCIO m whereSource

getPoolNumCapabilities :: m IntSource

Get the maximum number of available threads, which is set in `runCIO`

.

sequenceConcurrently :: [m a] -> m [a]Source

Same as `Control.Monad.`

, but performs concurrently.
`sequence`

sequenceConcurrently' :: [m a] -> m [a]Source

Same as `sequenceConcurrently`

with a difference that
it does not maintain the order of results,
which allows it to execute a bit more efficiently.

sequenceConcurrently_ :: [m a] -> m ()Source

Same as `Control.Monad.`

, but performs concurrently.
Blocks the calling thread until all actions are finished.
`sequence_`

mapMConcurrently :: MonadCIO m => (a -> m b) -> [a] -> m [b]Source

mapMConcurrently' :: MonadCIO m => (a -> m b) -> [a] -> m [b]Source

mapMConcurrently_ :: MonadCIO m => (a -> m b) -> [a] -> m ()Source

forMConcurrently :: MonadCIO m => [a] -> (a -> m b) -> m [b]Source

forMConcurrently' :: MonadCIO m => [a] -> (a -> m b) -> m [b]Source

forMConcurrently_ :: MonadCIO m => [a] -> (a -> m b) -> m ()Source

distributeConcurrently :: MonadCIO m => m a -> m [a]Source

Run the provided side-effecting action on all available threads and collect the results. The order of results may vary from run to run.

distributeConcurrently_ :: MonadCIO m => m a -> m ()Source

Run the provided side-effecting action on all available threads.