par package:monad-par -is:module

A wrapper around an underlying Par type which allows IO.
A library for parallel programming based on a monad The Par monad offers a simple API for parallel programming. The library works for parallelising both pure and IO computations, although only the pure version is deterministic. The default implementation provides a work-stealing scheduler and supports forking tasks that are much lighter weight than IO-threads. For complete documentation see Control.Monad.Par. Some examples of use can be found in the examples/ directory of the source package. Other related packages:
  • abstract-par provides the type classes that abstract over different implementations of the Par monad.
  • monad-par-extras provides extra combinators and monad transformers layered on top of the Par monad.
Changes in 0.3.4 relative to 0.3:
Run a parallel, deterministic computation and return its result. Note: you must NOT return an IVar in the output of the parallel computation. This is unfortunately not enforced, as it is with runST or with newer libraries that export a Par monad, such as lvish.
A version that avoids an internal unsafePerformIO for calling contexts that are already in the IO monad. Returning any value containing IVar is still disallowed, as it can compromise type safety.
A run method which allows actual IO to occur on top of the Par monad. Of course this means that all the normal problems of parallel IO computations are present, including nondeterminsm. A simple example program:
runParIO (liftIO $ putStrLn "hi" :: ParIO ())
Take the monadic fixpoint of a Par computation. This is the definition of mfix for Par. Throws FixParException if the result is demanded strictly within the computation.
Take the monadic fixpoint of a Par computation. This is the definition of mfix for Par.
An asynchronous version in which the main thread of control in a Par computation can return while forked computations still run in the background.