eve-0.1.2: An extensible event framework
Eve.Internal.States
Synopsis
type States = Map TypeRep StateWrapper Source #
A map of state types to their current value.
class HasStates s where Source #
Represents a state which can itself store more states. states is a lens which points to a given state's States map.
states
States
Minimal complete definition
Methods
states :: Lens' s States Source #
Instances
states :: Lens' AppState States Source #
class (Typeable s, HasStates s) => HasEvents s Source #
A typeclass to ensure people don't dispatch events to states which shouldn't accept them.
To allow dispatching events in an action over your state simply define the empty instance:
instance HasEvents MyState where
stateLens :: forall a e. (Show a, Typeable a, Default a, HasStates e) => Lens' e a Source #
A polymorphic lens which accesses stored states. It returns the default value (def) if a state has not yet been set.
def