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)
Two messages are consistent if they arrive from identical sources.