loopThroughRightSP :: SP (Either a b) (Either c d) -> SP c a -> SP b d
loopThroughRightSP
is a variation of the loop combinators that has turned out to be
useful when re-using stream processors. loopThroughRightSP
spnew spold
connects
two stream processors as shown in the diagram below:
The loop obtained with
is like the loop obtained
with loopThroughRightSP
spnew spoldloopLeftSP spnew
, with the addition that the loop goes
through spold
. spold
can only communicate with the
outside world by going via spnew
and is in this sense
encapsulated inside spnew
.
The corresponding fudget combinator: loopThroughRightF.