[Haskell-beginners] Understanding yampas par and dpSwitch

Nathan Hüsken nathan.huesken at posteo.de
Thu Apr 5 11:09:31 CEST 2012


I am currently working my way through the paper "Function Reactive
Programming Continued", which is about yampa.

On page 55 (page 5 in the pdf) "par" with the signature:

par :: Functor col => (forall sf . (a -> col sf -> col (b, sf)))
  -> col (SF b c)
  -> SF a (col c)

is introduced.
So the resulting signal function (of type SF a (col c)) takes its input
(of type a) and puts it into the first argument of par together with its
second argument (col (SF b c)) to receive a collection of input/signal
pairs (col (b, sf)). Correct?
My questions:

1. Shouldn't be the signature of the first argument be:
  a -> col (SF b c) -> col (b, (SF b c))
I mean it receives the second argument of par as its second argument?!?

2. When the collection of input signal/pairs is received (col (b, sf)),
the b is applied to sf, correct? Why not directly return the result of
this application?

I hope I was able to state clear enough questions ...

More information about the Beginners mailing list