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
- consistent :: Message a -> Message b -> Bool
- consistency :: Message a -> Message b -> Ordering
- peek :: Message a -> a
- data Transmitter a
- newTransmitterBy :: (a -> a -> Bool) -> IO (Transmitter a)
- newTransmitter :: Eq a => IO (Transmitter a)
- data Receiver a
- newReceiver :: IO (Receiver a)
- (<<*>>) :: Message (a -> b) -> Message a -> Message b
- send :: a -> IO (Message a)
- receive :: Receiver a -> Message a -> IO a
- transmit :: Transmitter a -> a -> IO (Message a)
Documentation
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.
data Transmitter a Source
An object that can memoize matching sequential outgoing messages.
newTransmitterBy :: (a -> a -> Bool) -> IO (Transmitter a)Source
newTransmitter :: Eq a => IO (Transmitter a)Source
Equivalent to newTransmitterBy (==)
.
newReceiver :: IO (Receiver a)Source
transmit :: Transmitter a -> a -> IO (Message a)Source
Tags an outgoing stream for memoization.