Elerea (Eventless Reactivity) is a simplistic FRP implementation that
parts with the concept of events, and uses a continuous latching
construct instead. The user sees the functionality through an
applicative interface, which is used to build up a network of
interconnected mutable references. The network is executed
iteratively, where each superstep consists of two phases:
sampling-aging and finalisation. As an example, the following code is
a possible way to define an approximation of our beloved trig
functions:

sine = integral 0 cosine
cosine = integral 1 (-sine)

Note that integral is not a primitive, it can be defined by the user
as a transfer function. A possible implementation that can be used on
any Fractional signal looks like this:

integral x0 s = transfer x0 (\dt x x0 -> x0+x*realToFrac dt) s

Head to FRP.Elerea.Internal for the implementation details. To get
a general idea how to use the library, check out the sources in the
elerea-examples package.

The Applicative instance with run-time optimisation. The <*>
operator tries to move all the pure parts to its left side in order to
flatten the structure, hence cutting down on book-keeping costs. Since
applicatives are used with pure functions and lifted values most of
the time, one can gain a lot by merging these nodes.

Dependency injection to allow aging signals whose output is not
necessarily needed to produce the current sample of the first
argument. It's equivalent to (flip . liftA2 . flip) const, as it
evaluates its second argument first.

A stateful transfer function. The current input affects the
current output, i.e. the initial state given in the first argument is
considered to appear before the first output, and can only be directly
observed by the sampleDelayed function.

Reactive signal that starts out as s and can change its
behaviour to the one supplied in ss whenever e is true. The
change can be observed immediately, unless the signal is sampled by
sampleDelayed, which puts a delay on the latch control (but not on
the latched signal!).

The delay transfer function emits the value of a signal from the
previous superstep, starting with the filler value given in the first
argument. It has to be a primitive, otherwise it could not be used to
prevent automatic delays.

A stream of tokens freshly generated in each superstep. These are
dummy values that must not be evaluated (they are in fact
undefined), but distributed among signals that need to be
constructed at the given moment in the absence of other dependencies
on current values, so as to prevent let-floating from moving otherwise
independent signals to an outer scope. Dependency on these tokens can
be established with the ==> operator.