¤ compEitherSP, -+-, et al

Stream processor combinators

Types

compEitherSP :: SP a1 a2 -> SP a3 b -> SP (a1  a3) (a2  b)
-+- :: SP a1 a2 -> SP a3 b -> SP (a1  a3) (a2  b)
compMsgSP :: SP a1 a2 -> SP a3 b -> SP (Message a1 a3) (Message a2 b)

Synopsis

compEitherSP sp1 sp2

data Message a b = Low a | High b

Description

These combinators provide tagged parallel composition of stream processors The output streams from the individual stream processors are tagged and merged into a single stream. The input stream, which must be tagged, is split up and fed to the appropriate stream processor.

The description below is for compEitherSP. compMsgSP is the same, except that it uses the type Message instead of Either.

Input

Messages tagged Left and Right are sent to the left and right stream processors, respectively.

Output

Messages from the left and right stream processors are tagged Left and Right, respectively.

Arguments

sp1 :: SP a1 a2
left stream processor
sp2 :: SP a3 b
right stream processor.

See Also

Untagged parallel composition: parSP.

The corresponding fudget combinator: >+<.

Serial composition: serCompSP.