In Functional reactive partner dancing, I mentioned that (a) the partially applied leading and following types have boilerplate
Applicative instances, and (b) the leading type corresponds to varying (reactive) values. Today I realized that those boilerplate instances are not very useful, and that they do not correspond to the
Applicative instance of
Reactive. In this post, I give a useful
Applicative instance that does correspond to the
Reactive instance. The instance definition is expressed in terms of the pair editor bot shown at the end of the “dancing” post, which seems to have a variety of applications.
Applicative instance has one awkward aspect that suggests a tweak to the formulation of leading. I give simplified versions of pair editing and
Applicative for the revised type. This change is in version 0.1 of the Bot libary.
Edit 2008-02-15: added FRP tags; prose tweak.