Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides access functions for working with the state stored within a bot session.
- askConfig :: Session e s Config
- askConfigS :: (Config -> a) -> Session e s a
- askBehavior :: Session e s (Behavior e s)
- askBehaviorS :: (Behavior e s -> a) -> Session e s a
- askEnv :: Session e s e
- askEnvS :: (e -> a) -> Session e s a
- getState :: Session e s s
- getStateS :: (s -> a) -> Session e s a
- putState :: s -> Session e s ()
- modifyState :: (s -> s) -> Session e s ()
Documentation
askConfigS :: (Config -> a) -> Session e s a Source
Retrieve a function of the bot configuration.
askBehavior :: Session e s (Behavior e s) Source
Fetch the bot behavior definition.
askBehaviorS :: (Behavior e s -> a) -> Session e s a Source
Retrieve a function of the bot behavior definition.
getStateS :: (s -> a) -> Session e s a Source
Get a specific component of the state, using a projection function supplied.
modifyState :: (s -> s) -> Session e s () Source
Update the state to the result of applying a function to the current state.