
On Monday 06 January 2003 04:02 am, Nicolas Oury wrote:
I think for example to event-driven arrows : we could make a pair of inputs without mixing the "event happened" information.
Here's one that's been baffling me: What about the case where you have two arrows you want to combine. Suppose that each of these arrows are a stream processor, which process the type Either. SP (Either a b) (Either a b) Now combing these with the sequencing operator is straightforward. The output of the first SP becomes the input of the second. (>>>) :: SP i o -> SP i o -> SP i o Or in a routing diagram In >- SP1 --> SP2 --> Out But what if you wanted to mix up the routing of Left and Right from the Either above? In(Left) -> SP1(Left) In(Right) -> SP2(Right) SP1(Right) -> SP2(Left) SP2(Left) -> SP1(Right) SP1(Left) -> Out(Left) SP2(Right) -> Out(Right) One could easily define an operator to do this, but then what if one wanted to combine three arrows with arbitrary routing of the signal? The problem becomes combinatorial quickly. Yet this is exactly what happens in circuit design and signal routing, or complex object oriented code. I imagine this like a multi-layer circuit board, each SP maintains it's own state and operates on multiple streams. The routing of these streams is arbitrary and complex. Maybe I'm just missing something trival and there's a simple way to do this already with arrows. Shawn