[Haskell-cafe] Yampa vs. Reactive

Paul L ninegua at gmail.com
Fri Dec 19 09:31:27 EST 2008

Nice to see this discussion, and I just want to comment on the
applicative v.s. arrow style. The example Henrik gave is

  z <- sf2 <<< sf1 -< x

which models a composition, and is in general the strength of a
combinator approach. But the strength of Applicative, in my opinion,
is not composition but currying:

  f <*> x <*> y

where f can have the type Behavior a -> Behavior b -> Behavior c. I
don't think there is an exact match in arrows. One could, however,
require sf to be of type SF (a, b) c, and write

  z <- sf -< (x, y)

The tupling may seem an extra burden, but it's an inherent design
choice of arrows, which builds data structure on top of products, and
people can't run away from it when writing arrow programs.

Paul Liu

Yale Haskell Group

More information about the Haskell-Cafe mailing list