monad-par-0.3.4.6: A library for parallel programming based on a monad

Safe HaskellNone

Control.Monad.Par.IO

Description

This module is an alternative version of Control.Monad.Par in which the Par type provides IO operations, by means of liftIO. The price paid is that only runParIO is available, not the pure runPar.

This module uses the same default scheduler as Control.Monad.Par.

Synopsis

Documentation

data ParIO a Source

A wrapper around an underlying Par type which allows IO.

data IVar a Source

Instances

ParFuture IVar Par 
ParFuture IVar ParIO 
ParIVar IVar Par 
ParIVar IVar ParIO 
Eq (IVar a)

Equality for IVars is physical equality, as with other reference types.

NFData (IVar a) 

runParIO :: ParIO a -> IO aSource

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 ())