lambdabot-core-5.1.0.1: Lambdabot core functionality

Safe HaskellNone
LanguageHaskell98

Lambdabot.Monad

Synopsis

Documentation

data IRCRState #

Global read-only state.

initRoState :: [DSum Config Identity] -> IO IRCRState #

Default ro state

waitForInit :: MonadLB m => m () #

waitForQuit :: MonadLB m => m () #

type Callback st = IrcMessage -> ModuleT st LB () #

type OutputFilter st = Nick -> [String] -> ModuleT st LB [String] #

type Server st = IrcMessage -> ModuleT st LB () #

data IRCRWState #

Global read/write state.

Constructors

IRCRWState 

Fields

Instances

initRwState :: IRCRWState #

Default rw state

data LB a #

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

instances Monad, Functor, MonadIO, MonadState, MonadError

Instances

Monad LB # 

Methods

(>>=) :: LB a -> (a -> LB b) -> LB b #

(>>) :: LB a -> LB b -> LB b #

return :: a -> LB a #

fail :: String -> LB a #

Functor LB # 

Methods

fmap :: (a -> b) -> LB a -> LB b #

(<$) :: a -> LB b -> LB a #

Applicative LB # 

Methods

pure :: a -> LB a #

(<*>) :: LB (a -> b) -> LB a -> LB b #

liftA2 :: (a -> b -> c) -> LB a -> LB b -> LB c #

(*>) :: LB a -> LB b -> LB b #

(<*) :: LB a -> LB b -> LB a #

MonadIO LB # 

Methods

liftIO :: IO a -> LB a #

MonadException LB # 

Methods

controlIO :: (RunIO LB -> IO (LB a)) -> LB a #

MonadConfig LB # 

Methods

getConfig :: Config a -> LB a #

MonadLogging LB # 

Methods

getCurrentLogger :: LB [String] #

logM :: String -> Priority -> String -> LB () #

MonadLB LB # 

Methods

lb :: LB a -> LB a #

MonadBase IO LB # 

Methods

liftBase :: IO α -> LB α #

MonadBaseControl IO LB # 

Associated Types

type StM (LB :: * -> *) a :: * #

Methods

liftBaseWith :: (RunInBase LB IO -> IO a) -> LB a #

restoreM :: StM LB a -> LB a #

MonadState IRCRWState LB # 

Methods

get :: LB IRCRWState #

put :: IRCRWState -> LB () #

state :: (IRCRWState -> (a, IRCRWState)) -> LB a #

type StM LB a # 

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

Minimal complete definition

lb

Methods

lb :: LB a -> m a #

Instances

MonadLB LB # 

Methods

lb :: LB a -> LB a #

MonadLB m => MonadLB (Cmd m) # 

Methods

lb :: LB a -> Cmd m a #

MonadLB m => MonadLB (ModuleT st m) # 

Methods

lb :: LB a -> ModuleT st m a #

registerModule :: String -> Module st -> st -> LB (ModuleInfo st) #

send :: IrcMessage -> LB () #

inModuleNamed :: String -> LB a -> (forall st. ModuleT st LB a) -> LB a #

Interpret an expression in the context of a module.

inModuleWithID :: ModuleID st -> LB a -> ModuleT st LB a -> LB a #

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

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

Interpret a function in the context of all modules