reaction-logic-2010.11.17: pluggable pure logic serializable reactor

Data.Reactor

Description

A reactor is an object to hold a bunch of reactions, which create other reactions and events and respond to events.

Synopsis

Documentation

data Reactor m c Source

The reactor object. Once created this closures control its lifecycle. Updaters return Nothing when the reactor is wrapped around no reactions.

Constructors

Reactor 

Fields

insertExternals :: [External] -> m (Maybe (Reactor m c))

Update itself digesting a new event

restoreReactor :: SerialReactor c -> m (Maybe (Reactor m c))

Regenerate itself from a serialization

serializeReactor :: SerialReactor c

Serialize its internals, for later restoring.

mkReactorSource

Arguments

:: (Functor m, MonadState c m) 
=> [Reaction m]

list of base reactions

-> Reactor m c

a fresh reactor object

build a reactor object from a list of basic reactions