lambdabot-core-5.0: Lambdabot core functionality

Safe HaskellNone
LanguageHaskell98

Lambdabot.Monad

Synopsis

Documentation

data IRCRState Source

Global read-only state.

initRoState :: [DSum Config] -> IO IRCRState Source

Default ro state

data ModuleRef Source

Constructors

forall st . ModuleRef (Module st) (MVar st) String 

data CommandRef Source

Constructors

forall st . CommandRef (Module st) (MVar st) String (Command (ModuleT st LB)) 

data IRCRWState Source

Global read/write state.

initRwState :: IRCRWState Source

Default rw state

newtype LB a Source

The IRC Monad. The reader transformer holds information about the connection to the IRC server.

instances Monad, Functor, MonadIO, MonadState, MonadError

Constructors

LB 

class (MonadIO m, MonadBaseControl IO m, MonadConfig m, MonadLogging m, Applicative m) => MonadLB m where Source

Methods

lb :: LB a -> m a Source

Instances

MonadLB LB 
MonadLB m => MonadLB (Cmd m) 
MonadLB m => MonadLB (ModuleT st m) 

evalLB :: LB a -> IRCRState -> IRCRWState -> IO a Source

run a computation in the LB monad

addServer :: String -> (IrcMessage -> LB ()) -> ModuleT mod LB () Source

withModule :: String -> LB a -> (forall st. Module st -> ModuleT st LB a) -> LB a Source

Interpret an expression in the context of a module. Arguments are which map to use (ircModules and ircCommands are the only sensible arguments here), the name of the module/command, action for the case that the lookup fails, action if the lookup succeeds.

withCommand :: String -> LB a -> (forall st. Module st -> Command (ModuleT st LB) -> ModuleT st LB a) -> LB a Source

withAllModules :: (forall st. Module st -> ModuleT st LB a) -> LB () Source

Interpret a function in the context of all modules