Safe Haskell | Safe |
---|---|
Language | Haskell98 |
This module implements something similar to
Control.Concurrent.PooledIO.InOrder,
but since it is restricted to an Applicative
interface
we can implement it without unsafeInterleaveIO
.
Documentation
runLimited :: Int -> T a -> IO a Source #
runLimited n
runs several actions in a pool with at most n
threads.
fork :: NFData a => IO a -> T a Source #
This runs an action parallelly to the starting thread.
Since it is an Applicative Functor and not a Monad,
there are no data dependencies between the actions
and thus all actions in a T
can be run parallelly.
Only the IO
actions are parallelised
but not the combining function passed to liftA2
et.al.
That is, the main work must be done in the IO
actions
in order to benefit from parallelisation.