|
Control.Concurrent.CHP.Utils |
|
|
Description |
A collection of useful functions to use with the library.
|
|
Synopsis |
|
|
|
Documentation |
|
|
Wires given processes up in a forward cycle. That is, the first process
writes to the second, and receives from the last. It returns the list of
wired-up processes, which you will almost certainly want to run in parallel.
|
|
wirePipeline :: forall a r w proc. Channel r w => [r a -> w a -> proc] -> r a -> w a -> CHP [proc] | Source |
|
Wires the given processes up in a forward pipeline. The first process
in the list is connected to the given reading channel-end (the first parameter)
and the writing end of a new channel, A. The second process is wired up
to the reading end of A, and the writing end of the next new channel, B.
This proceeds all the way to the end of the list, until the final process
is wired to the reading end of Z (if you have 27 processes in the list,
and therefore 26 channels in the middle of them) and the second parameter.
The list of wired-up processes is returned, which you can then run in parallel.
|
|
|
A specialised version of wirePipeline. Given a list of processes, composes
them into an ordered pipeline, that takes the channel-ends for the sticking
out ends of the pipeline and gives a process that returns a list of their
results. This is equivalent to wirePipeline, with the return value fed
to runParallel.
Added in version 1.0.2.
|
|
|
A specialised version of wireCycle. Given a list of processes, composes
them into a cycle and runs them all in parallel. This is equivalent to
wireCycle with the return value fed into runParallel.
Added in version 1.0.2.
|
|
|
Process composition. Given two processes, composes them into a pipeline,
like function composition (but with an opposite ordering). The function
is associative. Using wirePipeline will be more efficient than foldl1
(|->|) for more than two processes.
|
|
|
The reversed version of the other operator.
|
|
Produced by Haddock version 2.3.0 |