snap-predicates-0.3.1: Declarative routing for Snap.

Safe HaskellSafe-Inferred

Data.Predicate.Env

Synopsis

Documentation

data Env Source

An environment for predicates, consisting of mappings form ByteStrings to Dynamic values.

empty :: EnvSource

An empty environment.

lookup :: (MonadState m, StateType m ~ Env, Typeable a) => ByteString -> m (Maybe a)Source

Try to get the associated value for the given key. Only successful iff, (i) Env contains a binding for k and (ii) the type of value and target match.

insert :: (MonadState m, StateType m ~ Env, Typeable a) => ByteString -> a -> m ()Source

Add a binding from key to value to Env, overriding previous bindings if existing.