A newbie question about Arrows.

Magnus Carlsson magnus@cse.ogi.edu
Mon, 13 Jan 2003 20:59:37 -0800


Shawn P. Garbett writes:
 ...
 > Or in a routing diagram
 >=20
 > In >- SP1 --> SP2 --> Out
 >=20
 > But what if you wanted to mix up the routing of Left and Right from
 > the Either above?
 >=20
 > 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 =3D proc i1 =D7 i2 -> do=20

                   rec i1 =D7 l2 >- sp1 -> l1 =D7 r1
                       r1 =D7 i2 >- sp2 -> l2 =D7 r2

                   l1 =D7 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