[reactive] Essential Reactive functions?

Jake McArthur jake at pikewerks.com
Fri Dec 26 11:44:50 EST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Peter Verswyvelen wrote:
> But what is the minimal set of functions one must implement to build a
> Reactive library, in the sense that all others can be implemented using
> these?

My in-progress FRP implementation is loosely based on Reactive. The
semantics are essentially the same, although the interface is becoming a
bit different, the implementation is completely different, and mine has
some limitations (which I may decide to intentionally leave in) which
Reactive does not. Keeping in mind that I haven't implemented all
functionality yet, these are the functions I currently have which
require unexported constructors and functions, ignoring some which have
to do with my changed interface:

* Functor     Event        functions
* Monoid      (Event a)    functions
* Functor     Reactive     functions
* Applicative Reactive     functions
* Functor     (Behavior t) functions
* Applicative (Behavior t) functions
* rToB       :: Reactive a -> Behavior t a
* accumE     :: a -> Event (a -> a) -> Event a
* stepper    :: a -> Event a -> Reactive a
* snapshot   :: Event a -> Reactive b -> Event (a, b)
* time       :: Behavior t t
* timeR      -- a type specific to my interface
* filterE    :: (a -> Bool) -> Event a -> Event a
* partitionE :: (a -> Bool) -> Event a -> (Event a, Event a)

I plan to eventually separate these core functions from my derived
functions into different modules, making these distinctions more clear.
I also suspect that this set is not as minimal as it can be and will try
to make it shorter in the future.

I know this doesn't necessarily help you since mine is not really
Reactive, but I thought perhaps it could give you at least an idea.

- - Jake
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAklVCfwACgkQye5hVyvIUKkS1gCgscABZOLtz5AafRsI9hC8IbTF
NJkAoMB5xQleVJc5R0hPMJ5NS+Gl2ShY
=doca
-----END PGP SIGNATURE-----


More information about the Reactive mailing list