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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.