eventful-memory-0.1.3: In-memory implementations for eventful

Safe HaskellNone
LanguageHaskell2010

Eventful.Store.Memory

Synopsis

Documentation

tvarEventStore :: TVar (EventMap serialized) -> EventStore serialized STM Source #

An EventStore that stores events in a TVar and runs in STM. This functions initializes the store by creating the TVar and hooking up the event store API to that TVar.

stateEventStore :: MonadState (EventMap serialized) m => EventStore serialized m Source #

Specialized version of embeddedStateEventStore that only contains an EventMap in the state.

embeddedStateEventStore :: MonadState s m => (s -> EventMap serialized) -> (s -> EventMap serialized -> s) -> EventStore serialized m Source #

An EventStore that runs on some MonadState that contains an EventMap. This is useful if you want to include other state in your MonadState.

data EventMap serialized Source #

Internal data structure used for the in-memory event stores.

Instances

Show serialized => Show (EventMap serialized) Source # 

Methods

showsPrec :: Int -> EventMap serialized -> ShowS #

show :: EventMap serialized -> String #

showList :: [EventMap serialized] -> ShowS #

emptyEventMap :: EventMap serialized Source #

What it says on the tin, an initialized empty EventMap

eventMapTVar :: IO (TVar (EventMap serialized)) Source #

Initialize an EventMap in a TVar