Reading John Hughes's Generalising monads to arrows, I understand that arrows can be used to represent and combine stream processors with a single input and a single output. It is also possible to represent multiple inputs and outputs using pairs, or using ArrowChoice
.
However, using a pair means the input is a stream of pairs, which isn't enough to express processing streams that arrive at difference rates. ArrowChoice
is able express that, but it "multiplexes" the two streams in a single one.
I'm looking for a way to combine streams with multiple inputs and multiple outputs, while still being able to distinguish between the case where the streams are multiplexed and the case of separate streams.
Is that possible?