HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulepooled-io-0.0.2.3Haskell98

Control.Concurrent.PooledIO.Final

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.

  • 1 type
  • 3 values
newtypenewtype T a
#
Instances2Functor, Applicative
  • Functor TDefined in pooled-io-0.0.2.3 · Control.Concurrent.PooledIO.Final
  • Applicative TDefined in pooled-io-0.0.2.3 · Control.Concurrent.PooledIO.Final
valuerunLimited :: Int -> T a -> IO a
#

runLimited n runs several actions in a pool with at most n threads.

valuefork :: NFData a => IO a -> T a
#

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.