Reactive-banana – Safe and simple semantics

The third and final approach to FRP we'll take a look at is Reactive-banana. Like Yampa, we have both continuous- and discrete-time semantics at our disposal. In Reactive-banana terminology, events describe discrete time, while behaviors describe continuous time. Behaviors in Reactive-banana are like signals in Elerea. Historically, the names event and behavior were the first to occur:

data Event a    -- instance Functor
data Behavior a -- instance Functor, Applicative

Note that behavior is not Monad, unlike Elerea's signal, which did have a Monad instance. Instead, Reactive-banana supports moments as reactive computation contexts. There is a pure Moment monad, impure MomentIO monad and MonadMoment class ...

Get Haskell High Performance Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.