Control-Monad-MultiPass-0.1.0.0: A Library for Writing Multi-Pass Algorithms.

Safe HaskellSafe

Control.Monad.MultiPass.Utils

Description

Utility functions for the Control.Monad.MultiPass library.

Synopsis

Documentation

mapST2ArrayMPSource

Arguments

:: (Ix i, Num i) 
=> NumThreads

Number of threads to spawn

-> ST2Array r w i a

Input array

-> (a -> MultiPass r w tc b)

Mapping function

-> MultiPass r w tc (ST2Array r w i b)

Output array

This function provides a similar interface to mapM, but is specifically for mapping over the ST2Array datatype in the MultiPass monad.

mapST2ArrayMP_Source

Arguments

:: (Ix i, Num i) 
=> NumThreads

Number of threads to spawn

-> ST2Array r w i a

Input array

-> (a -> MultiPass r w tc b)

Mapping function

-> MultiPass r w tc () 

This function provides a similar interface to mapM_, but is specifically for mapping over the ST2Array datatype in the MultiPass monad.

pmapM :: (Traversable t, Monad m, Monad p) => t a -> (a -> m (p b)) -> m (p (t b))Source

This function provides a similar interface to mapM, but is useful for mapping over a datatype in a specific pass of the MultiPass monad. Note: the m type is usually the MultiPass monad, but the implementation does not specifically depend on anything from the Control.Monad.MultiPass library, so its type is more general.