Tutorial by Examples

This example is not tied to any concrete GUI toolkit, like reactive-banana-wx does, for instance. Instead it shows how to inject arbitary IO actions into FRP machinery. The Control.Event.Handler module provides an addHandler function which creates a pair of AddHandler a and a -> IO () values. Th...
In reactive-banana the Event type represents a stream of some events in time. An Event is similar to an analog impulse signal in the sense that it is not continuous in time. As a result, Event is an instance of the Functor typeclass only. You can't combine two Events together because they may fire a...
To represent continious signals, reactive-banana features Behavior a type. Unlike Event, a Behavior is an Applicative, which lets you combine n Behaviors using an n-ary pure function (using <$> and <*>). To obtain a Behavior a from the Event a there is accumE function: main = do (...
EventNetworks returned by compile must be actuated before reactimated events have an effect. main = do (inputHandler, inputFire) <- newAddHandler eventNetwork <- compile $ do inputEvent <- fromAddHandler inputHandler let inputEventReaction = fmap putStrLn inp...

Page 1 of 1