{-# LANGUAGE Rank2Types, FlexibleContexts #-}
{-# OPTIONS_HADDOCK hide #-}
module Control.Concurrent.SCC.Combinators.Parallel (
Combinators.consumeBy, Combinators.prepend, Combinators.append, Combinators.substitute,
PipeableComponentPair, (>->), Combinators.JoinableComponentPair (Combinators.sequence), join,
Combinators.sNot,
(>&), (>|),
(&&), (||),
ifs, wherever, unless, Combinators.select,
while, nestedIn,
foreach, having, havingOnly, followedBy, Combinators.even,
Combinators.first, Combinators.uptoFirst, Combinators.prefix,
Combinators.last, Combinators.lastAndAfter, Combinators.suffix,
Combinators.startOf, Combinators.endOf, (...),
Combinators.splitterToMarker, Combinators.parseRegions,
)
where
import Prelude hiding ((&&), (||), even, last, sequence)
import Data.Monoid (Monoid)
import Data.Text (Text)
import Control.Monad.Parallel (MonadParallel)
import Control.Monad.Coroutine (parallelBinder)
import Data.Monoid.Null (MonoidNull)
import Data.Monoid.Factorial (FactorialMonoid)
import Control.Concurrent.SCC.Types
import Control.Concurrent.SCC.Coercions (Coercible)
import qualified Control.Concurrent.SCC.Combinators as Combinators
import qualified Control.Concurrent.SCC.XML as XML
(>->) :: (MonadParallel m, PipeableComponentPair m w c1 c2 c3) => c1 -> c2 -> c3
>-> :: forall (m :: * -> *) w c1 c2 c3.
(MonadParallel m, PipeableComponentPair m w c1 c2 c3) =>
c1 -> c2 -> c3
(>->) = PairBinder m -> c1 -> c2 -> c3
forall (m :: * -> *) w c1 c2 c3.
PipeableComponentPair m w c1 c2 c3 =>
PairBinder m -> c1 -> c2 -> c3
compose (x -> y -> m r) -> m x -> m y -> m r
PairBinder m
forall (m :: * -> *). MonadParallel m => PairBinder m
parallelBinder
join :: (MonadParallel m, Combinators.JoinableComponentPair t1 t2 t3 m x y c1 c2 c3) => c1 -> c2 -> c3
join :: forall (m :: * -> *) t1 t2 t3 x y c1 c2 c3.
(MonadParallel m, JoinableComponentPair t1 t2 t3 m x y c1 c2 c3) =>
c1 -> c2 -> c3
join = PairBinder m -> c1 -> c2 -> c3
forall t1 t2 t3 (m :: * -> *) x y c1 c2 c3.
JoinableComponentPair t1 t2 t3 m x y c1 c2 c3 =>
PairBinder m -> c1 -> c2 -> c3
Combinators.join (x -> y -> m r) -> m x -> m y -> m r
PairBinder m
forall (m :: * -> *). MonadParallel m => PairBinder m
parallelBinder
(>&) :: (MonadParallel m, Monoid x) => Splitter m x -> Splitter m x -> Splitter m x
>& :: forall (m :: * -> *) x.
(MonadParallel m, Monoid x) =>
Splitter m x -> Splitter m x -> Splitter m x
(>&) = PairBinder m -> Splitter m x -> Splitter m x -> Splitter m x
forall (m :: * -> *) x.
(Monad m, Monoid x) =>
PairBinder m -> Splitter m x -> Splitter m x -> Splitter m x
Combinators.sAnd (x -> y -> m r) -> m x -> m y -> m r
PairBinder m
forall (m :: * -> *). MonadParallel m => PairBinder m
parallelBinder
(>|) :: (MonadParallel m, Monoid x) => Splitter m x -> Splitter m x -> Splitter m x
>| :: forall (m :: * -> *) x.
(MonadParallel m, Monoid x) =>
Splitter m x -> Splitter m x -> Splitter m x
(>|) = PairBinder m -> Splitter m x -> Splitter m x -> Splitter m x
forall (m :: * -> *) x.
(Monad m, Monoid x) =>
PairBinder m -> Splitter m x -> Splitter m x -> Splitter m x
Combinators.sOr (x -> y -> m r) -> m x -> m y -> m r
PairBinder m
forall (m :: * -> *). MonadParallel m => PairBinder m
parallelBinder
(&&) :: (MonadParallel m, FactorialMonoid x) => Splitter m x -> Splitter m x -> Splitter m x
&& :: forall (m :: * -> *) x.
(MonadParallel m, FactorialMonoid x) =>
Splitter m x -> Splitter m x -> Splitter m x
(&&) = PairBinder m -> Splitter m x -> Splitter m x -> Splitter m x
forall (m :: * -> *) x.
(Monad m, FactorialMonoid x) =>
PairBinder m -> Splitter m x -> Splitter m x -> Splitter m x
Combinators.pAnd (x -> y -> m r) -> m x -> m y -> m r
PairBinder m
forall (m :: * -> *). MonadParallel m => PairBinder m
parallelBinder
(||) :: (MonadParallel m, FactorialMonoid x) => Splitter m x -> Splitter m x -> Splitter m x
|| :: forall (m :: * -> *) x.
(MonadParallel m, FactorialMonoid x) =>
Splitter m x -> Splitter m x -> Splitter m x
(||) = PairBinder m -> Splitter m x -> Splitter m x -> Splitter m x
forall (m :: * -> *) x.
(Monad m, FactorialMonoid x) =>
PairBinder m -> Splitter m x -> Splitter m x -> Splitter m x
Combinators.pOr (x -> y -> m r) -> m x -> m y -> m r
PairBinder m
forall (m :: * -> *). MonadParallel m => PairBinder m
parallelBinder
ifs :: (MonadParallel m, Monoid x, Branching c m x ()) => Splitter m x -> c -> c -> c
ifs :: forall (m :: * -> *) x c.
(MonadParallel m, Monoid x, Branching c m x ()) =>
Splitter m x -> c -> c -> c
ifs = PairBinder m -> Splitter m x -> c -> c -> c
forall c (m :: * -> *) x.
(Monad m, Branching c m x ()) =>
PairBinder m -> Splitter m x -> c -> c -> c
Combinators.ifs (x -> y -> m r) -> m x -> m y -> m r
PairBinder m
forall (m :: * -> *). MonadParallel m => PairBinder m
parallelBinder
wherever :: (MonadParallel m, Monoid x) => Transducer m x x -> Splitter m x -> Transducer m x x
wherever :: forall (m :: * -> *) x.
(MonadParallel m, Monoid x) =>
Transducer m x x -> Splitter m x -> Transducer m x x
wherever = PairBinder m
-> Transducer m x x -> Splitter m x -> Transducer m x x
forall (m :: * -> *) x.
(Monad m, Monoid x) =>
PairBinder m
-> Transducer m x x -> Splitter m x -> Transducer m x x
Combinators.wherever (x -> y -> m r) -> m x -> m y -> m r
PairBinder m
forall (m :: * -> *). MonadParallel m => PairBinder m
parallelBinder
unless :: (MonadParallel m, Monoid x) => Transducer m x x -> Splitter m x -> Transducer m x x
unless :: forall (m :: * -> *) x.
(MonadParallel m, Monoid x) =>
Transducer m x x -> Splitter m x -> Transducer m x x
unless = PairBinder m
-> Transducer m x x -> Splitter m x -> Transducer m x x
forall (m :: * -> *) x.
(Monad m, Monoid x) =>
PairBinder m
-> Transducer m x x -> Splitter m x -> Transducer m x x
Combinators.unless (x -> y -> m r) -> m x -> m y -> m r
PairBinder m
forall (m :: * -> *). MonadParallel m => PairBinder m
parallelBinder
while :: (MonadParallel m, MonoidNull x) => Transducer m x x -> Splitter m x -> Transducer m x x
while :: forall (m :: * -> *) x.
(MonadParallel m, MonoidNull x) =>
Transducer m x x -> Splitter m x -> Transducer m x x
while Transducer m x x
t Splitter m x
s = PairBinder m
-> Transducer m x x
-> Splitter m x
-> Transducer m x x
-> Transducer m x x
forall (m :: * -> *) x.
(Monad m, MonoidNull x) =>
PairBinder m
-> Transducer m x x
-> Splitter m x
-> Transducer m x x
-> Transducer m x x
Combinators.while (x -> y -> m r) -> m x -> m y -> m r
PairBinder m
forall (m :: * -> *). MonadParallel m => PairBinder m
parallelBinder Transducer m x x
t Splitter m x
s (Transducer m x x -> Splitter m x -> Transducer m x x
forall (m :: * -> *) x.
(MonadParallel m, MonoidNull x) =>
Transducer m x x -> Splitter m x -> Transducer m x x
while Transducer m x x
t Splitter m x
s)
nestedIn :: (MonadParallel m, MonoidNull x) => Splitter m x -> Splitter m x -> Splitter m x
nestedIn :: forall (m :: * -> *) x.
(MonadParallel m, MonoidNull x) =>
Splitter m x -> Splitter m x -> Splitter m x
nestedIn Splitter m x
s1 Splitter m x
s2 = PairBinder m
-> Splitter m x -> Splitter m x -> Splitter m x -> Splitter m x
forall (m :: * -> *) x.
(Monad m, MonoidNull x) =>
PairBinder m
-> Splitter m x -> Splitter m x -> Splitter m x -> Splitter m x
Combinators.nestedIn (x -> y -> m r) -> m x -> m y -> m r
PairBinder m
forall (m :: * -> *). MonadParallel m => PairBinder m
parallelBinder Splitter m x
s1 Splitter m x
s2 (Splitter m x -> Splitter m x -> Splitter m x
forall (m :: * -> *) x.
(MonadParallel m, MonoidNull x) =>
Splitter m x -> Splitter m x -> Splitter m x
nestedIn Splitter m x
s1 Splitter m x
s2)
foreach :: (MonadParallel m, MonoidNull x, Branching c m x ()) => Splitter m x -> c -> c -> c
foreach :: forall (m :: * -> *) x c.
(MonadParallel m, MonoidNull x, Branching c m x ()) =>
Splitter m x -> c -> c -> c
foreach = PairBinder m -> Splitter m x -> c -> c -> c
forall (m :: * -> *) x c.
(Monad m, MonoidNull x, Branching c m x ()) =>
PairBinder m -> Splitter m x -> c -> c -> c
Combinators.foreach (x -> y -> m r) -> m x -> m y -> m r
PairBinder m
forall (m :: * -> *). MonadParallel m => PairBinder m
parallelBinder
having :: (MonadParallel m, MonoidNull x, MonoidNull y, Coercible x y) => Splitter m x -> Splitter m y -> Splitter m x
having :: forall (m :: * -> *) x y.
(MonadParallel m, MonoidNull x, MonoidNull y, Coercible x y) =>
Splitter m x -> Splitter m y -> Splitter m x
having = PairBinder m -> Splitter m x -> Splitter m y -> Splitter m x
forall (m :: * -> *) x y.
(Monad m, MonoidNull x, MonoidNull y, Coercible x y) =>
PairBinder m -> Splitter m x -> Splitter m y -> Splitter m x
Combinators.having (x -> y -> m r) -> m x -> m y -> m r
PairBinder m
forall (m :: * -> *). MonadParallel m => PairBinder m
parallelBinder
havingOnly :: (MonadParallel m, MonoidNull x, MonoidNull y, Coercible x y) =>
Splitter m x -> Splitter m y -> Splitter m x
havingOnly :: forall (m :: * -> *) x y.
(MonadParallel m, MonoidNull x, MonoidNull y, Coercible x y) =>
Splitter m x -> Splitter m y -> Splitter m x
havingOnly = PairBinder m -> Splitter m x -> Splitter m y -> Splitter m x
forall (m :: * -> *) x y.
(Monad m, MonoidNull x, MonoidNull y, Coercible x y) =>
PairBinder m -> Splitter m x -> Splitter m y -> Splitter m x
Combinators.havingOnly (x -> y -> m r) -> m x -> m y -> m r
PairBinder m
forall (m :: * -> *). MonadParallel m => PairBinder m
parallelBinder
followedBy :: (MonadParallel m, FactorialMonoid x) => Splitter m x -> Splitter m x -> Splitter m x
followedBy :: forall (m :: * -> *) x.
(MonadParallel m, FactorialMonoid x) =>
Splitter m x -> Splitter m x -> Splitter m x
followedBy = PairBinder m -> Splitter m x -> Splitter m x -> Splitter m x
forall (m :: * -> *) x.
(Monad m, FactorialMonoid x) =>
PairBinder m -> Splitter m x -> Splitter m x -> Splitter m x
Combinators.followedBy (x -> y -> m r) -> m x -> m y -> m r
PairBinder m
forall (m :: * -> *). MonadParallel m => PairBinder m
parallelBinder
(...) :: (MonadParallel m, FactorialMonoid x) => Splitter m x -> Splitter m x -> Splitter m x
... :: forall (m :: * -> *) x.
(MonadParallel m, FactorialMonoid x) =>
Splitter m x -> Splitter m x -> Splitter m x
(...) = PairBinder m -> Splitter m x -> Splitter m x -> Splitter m x
forall (m :: * -> *) x.
(Monad m, FactorialMonoid x) =>
PairBinder m -> Splitter m x -> Splitter m x -> Splitter m x
Combinators.between (x -> y -> m r) -> m x -> m y -> m r
PairBinder m
forall (m :: * -> *). MonadParallel m => PairBinder m
parallelBinder