Shawn P. Garbett writes:
 ...
 > 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)

With the preprocessor at

  http://www.cse.ogi.edu/~magnus/ProdArrows/

this routing problem can be expressed as

  route sp1 sp2 = proc i1 × i2 -> do 

                   rec i1 × l2 >- sp1 -> l1 × r1
                       r1 × i2 >- sp2 -> l2 × r2

                   l1 × r2 >- arr id

(Wouldn't it be nice if we had an editor that could present a
graphical view of this program as a different aspect?)

All the best,
/M
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to