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
parallel :: m ~> f
sequential :: f ~> m
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
Newtype (ParCont m a) _
(MonadEff eff m) => Functor (ParCont m)
(MonadEff eff m) => Apply (ParCont m)
(MonadEff eff m) => Applicative (ParCont m)
(MonadEff eff m) => Alt (ParCont m)
(MonadEff eff m) => Plus (ParCont m)
(MonadEff eff m) => Alternative (ParCont m)
(MonadEff eff m) => Parallel (ParCont m) (ContT Unit m)