happstack-state-0.5.1: Event-based distributed state.

Happstack.State.Monad

Synopsis

Documentation

setUpdateType :: Proxy t -> Update t ()Source

Use a proxy to force the type of an update action.

proxyUpdate :: Update t b -> Proxy t -> Update t bSource

Forces the type of the proxy and update to match

setQueryType :: Proxy t -> Query t ()Source

Use a proxy to force the type of a query action.

proxyQuery :: Query t b -> Proxy t -> Query t bSource

Forces the type of proxy and query to match

asUpdate :: Update t a -> Proxy t -> Update t aSource

Currying version of setUpdateType.

asQuery :: Query t a -> Proxy t -> Query t aSource

Currying version of setQueryType.

askState :: Query st stSource

Specialized version of ask

getState :: Update st stSource

Specialized version of get

putState :: st -> Update st ()Source

Specialized version of put.

liftSTM :: STM a -> AnyEv aSource

Lift an STM action into Ev.

class CatchEv m whereSource

Methods

catchEv :: Ev m a -> (SomeException -> a) -> Ev m aSource

sel :: (Env -> b) -> AnyEv bSource

Select a part of the environment.

localState :: (outer -> inner) -> (inner -> outer -> outer) -> Ev (StateT inner STM) a -> Ev (StateT outer STM) aSource

Run a computation with local state. Changes to state will be visible to outside.

localStateReader :: (outer -> inner) -> Ev (ReaderT inner STM) a -> Ev (ReaderT outer STM) aSource

Run a computation with local state.

runQuery :: Query st a -> Update st aSource

Execute a Query action in the Update monad.