rsagl-frp- The RogueStar Animation and Graphics Library: Functional Reactive Programming



A memoization scheme in which a piece of information is tagged with a unique identifier for its source. Messages can be combined, and the tagging information indicates the specific combination. On the receiving end, we memoize the single most recent incoming message, and reuse it if the source information matches.



data Message a Source

A sourced packet of information.

consistent :: Message a -> Message b -> BoolSource

Two messages are consistent if they arrive from identical sources.

consistency :: Message a -> Message b -> OrderingSource

An arbitrary ordering scheme on messages.

peek :: Message a -> aSource

Examine a message without memoization.

data Transmitter a Source

An object that can memoize matching sequential outgoing messages.

newTransmitter :: Eq a => IO (Transmitter a)Source

Equivalent to newTransmitterBy (==).

data Receiver a Source

An object that can memoize sequentially matching incoming messages.

(<<*>>) :: Message (a -> b) -> Message a -> Message bSource

Bind two messages.

send :: a -> IO (Message a)Source

Construct a new message from a one-time source.

receive :: Receiver a -> Message a -> IO aSource

Memoizes an incomming message stream.

transmit :: Transmitter a -> a -> IO (Message a)Source

Tags an outgoing stream for memoization.