irc-fun-bot-0.1.0.0: Very simple library for writing fun IRC bots.

Safe HaskellNone
LanguageHaskell2010

Network.IRC.Fun.Bot.State

Description

This module provides access functions for working with the state stored within a bot session.

Synopsis

Documentation

askConfig :: Session e s Config Source

Fetch the bot configuration.

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.

askEnv :: Session e s e Source

Fetch the bot environment, i.e. read-only state.

askEnvS :: (e -> a) -> Session e s a Source

Retrieve a function of the bot environment.

getState :: Session e s s Source

Fetch the current value of the state within the session.

getStateS :: (s -> a) -> Session e s a Source

Get a specific component of the state, using a projection function supplied.

putState :: s -> Session e s () Source

Set the state within the session.

modifyState :: (s -> s) -> Session e s () Source

Update the state to the result of applying a function to the current state.