[Haskell-cafe] Troubles understanding memoization in SOE

Bertram Felgenhauer bertram.felgenhauer at googlemail.com
Wed Sep 26 08:06:07 EDT 2007

Peter Verswyvelen wrote:
> Paul L wrote:
> A minor detail in your paper: on page 7, you represent *(d) sf1 &&& sf2 *as 
> a big box taking one input and producing two outputs. The input is 
> internally split using a Y. This does not seem consistent with the other 
> boxes (e.g. *first *or *loop *internally) that show two arrows for an 
> incoming/outgoing pair, so I would say the outer box of &&& would also have 
> two inputs and two outputs.

But look at the type of &&&:
  (&&&) :: Arrow a => a b c -> a b c' -> a b (c, c')
or, perhaps more readable,
  (&&&) :: Arrow (~>) => (b ~> c) -> (b ~> c') -> (b ~> (c, c'))

As you can see, the resulting arrow of type (b ~> (c, c')) really has
only one input and produces a pair, i.e. two outputs. Internally it
must duplicate the b input somehow and apply it to both input arrows,
exactly as the box shows.


More information about the Haskell-Cafe mailing list