F >x> G
The execution of F >x> G
starts by executing F. Whenever F
publishes a value, a new execution of G begins in parallel with F (and with any previous
executions of G); in that execution of G, variable x is bound to the value
published by F. Any value
published by any executions of G is published by the whole expression, but the values published
by F are not published by the whole expression; they are consumed by the variable binding.
F >P> G
The sequential combinator may be written as F >P> G,
where P is a pattern instead of
just a variable name. Any value published by F is matched against the pattern P.
If this match is successful, a new execution of G begins, with all of the bindings
from the match. Otherwise, the published value is simply ignored, and no new execution
of G is begun.
F >> G
This is equivalent to using a wildcard pattern: F >_> G. Every publication
of F will match the combinator pattern, causing an execution of G for every individual
publication of F. No bindings will be made in G from these publications.
|
Combinator Precedence Level: sequential > parallel > pruning > otherwise [Full Table]
The type of F >P> G
is the type of G in the context ΓF,
where ΓF is the result of matching the pattern P against the type of F.
{- Publish 1 and 2 in parallel -} (0 | 1) >n> n+1 {- OUTPUT:PERMUTABLE 1 2 -}
{- Filter out values of the form (_,false) -} ( (4,true) | (5,false) | (6,true) ) >(x,true)> x {- OUTPUT:PERMUTABLE 4 6 -}
{- Print two strings to the console, but don't publish the return values of the calls. -} Println("goodbye") >> Println("world") >> stop {- OUTPUT: goodbye world -}
Related Reference Topics
Related Tutorial Sections