Module

Control.Parallel.Class

Package
purescript-parallel
Repository
purescript/purescript-parallel

#Parallel Source

class (Monad m, Applicative f) <= Parallel f m | m -> f, f -> m where

The Parallel class abstracts over monads which support parallel composition via some related Applicative.

Members

Instances

#ParCont Source

newtype ParCont m a

The ParCont type constructor provides an Applicative instance based on ContT Unit m, which waits for multiple continuations to be resumed simultaneously.

ParCont sections of code can be embedded in sequential code by using the parallel and sequential functions:

loadModel :: ContT Unit (Eff (ajax :: AJAX)) Model
loadModel = do
  token <- authenticate
  sequential $
    Model <$> parallel (get "/products/popular/" token)
          <*> parallel (get "/categories/all" token)

Constructors

Instances