Changes between Version 3 and Version 4 of monad-parallel

Show
Ignore:
Timestamp:
03/20/10 20:14:17 (5 years ago)
Author:
blamario (IP: 99.241.117.248)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • monad-parallel

    v3 v4  
    2020 
    2121{{{ 
    22 task1 :: Monad Int 
    23 task2 :: Monad Int 
    24 task3 :: Monad Int 
     22task1 :: MonadFork m => m Int 
     23task2 :: MonadFork m => m Int 
     24task3 :: MonadFork m => m Int 
    2525 
    2626example = do handle1 <- forkExec task1 
     
    4040}}} 
    4141 
     42This method executes its `m a` and `m b` arguments in parallel. Once they're both finished, ''bindM2'' runs their results through its first argument and returns the final result. Note that 'bindM2' can be implemented using `forkExec`, but not vice versa. 
     43 
     44Based on this foundation, the library defines and exports other useful functions. These replicate the functionality of the [http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.2.0.0/Control-Monad.html Control.Monad] module, but they execute their monadic arguments in parallel. 
     45 
     46{{{ 
     47 bindM3 :: MonadParallel m => (a -> b -> c -> m d) -> m a -> m b -> m c -> m d 
     48 liftM2 :: MonadParallel m => (a -> b -> c) -> m a -> m b -> m c 
     49 liftM3  :: (MonadParallel m) => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r 
     50 ap :: MonadParallel m => m (a -> b) -> m a -> m b 
     51 sequence :: MonadParallel m => [m a] -> m [a] 
     52 sequence_ :: MonadParallel m => [m a] -> m ()  
     53 mapM :: MonadParallel m => (a -> m b) -> [a] -> m [b] 
     54 replicateM :: MonadParallel m => Int -> m a -> m [a] 
     55 replicateM_ :: MonadParallel m => Int -> m a -> m () 
     56}}}