lambdabot-core-5.3.0.1: Lambdabot core functionality
Safe HaskellNone
LanguageHaskell98

Lambdabot.Monad

Synopsis

Documentation

data IRCRState Source #

Global read-only state.

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

Default ro state

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

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

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

data IRCRWState Source #

Global read/write state.

Constructors

IRCRWState 

Fields

Instances

Instances details
MonadState IRCRWState LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

get :: LB IRCRWState

put :: IRCRWState -> LB ()

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

initRwState :: IRCRWState Source #

Default rw state

data LB a Source #

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

instances Monad, Functor, MonadIO, MonadState, MonadError

Instances

Instances details
Monad LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

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

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

return :: a -> LB a

Functor LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

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

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

MonadFail LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

fail :: String -> LB a

Applicative LB Source # 
Instance details

Defined in Lambdabot.Monad

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

MonadThrow LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

throwM :: Exception e => e -> LB a Source #

MonadCatch LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

catch :: Exception e => LB a -> (e -> LB a) -> LB a Source #

MonadMask LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

mask :: ((forall a. LB a -> LB a) -> LB b) -> LB b Source #

uninterruptibleMask :: ((forall a. LB a -> LB a) -> LB b) -> LB b Source #

generalBracket :: LB a -> (a -> ExitCase b -> LB c) -> (a -> LB b) -> LB (b, c) Source #

MonadRandom LB Source # 
Instance details

Defined in Lambdabot.Bot

MonadIO LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

liftIO :: IO a -> LB a

MonadConfig LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

getConfig :: Config a -> LB a Source #

MonadLogging LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

getCurrentLogger :: LB [String] Source #

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

MonadException LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

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

MonadLB LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

lb :: LB a -> LB a Source #

MonadBase IO LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

liftBase :: IO α -> LB α Source #

MonadBaseControl IO LB Source # 
Instance details

Defined in Lambdabot.Monad

Associated Types

type StM LB a Source #

Methods

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

restoreM :: StM LB a -> LB a Source #

MonadState IRCRWState LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

get :: LB IRCRWState

put :: IRCRWState -> LB ()

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

type StM LB a Source # 
Instance details

Defined in Lambdabot.Monad

type StM LB a = StM (ReaderT (IRCRState, IORef IRCRWState) IO) a

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

Methods

lb :: LB a -> m a Source #

Instances

Instances details
MonadLB LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

lb :: LB a -> LB a Source #

MonadLB m => MonadLB (Cmd m) Source # 
Instance details

Defined in Lambdabot.Monad

Methods

lb :: LB a -> Cmd m a Source #

MonadLB m => MonadLB (ModuleT st m) Source # 
Instance details

Defined in Lambdabot.Monad

Methods

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

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

registerCallback :: String -> Callback st -> ModuleT st LB () Source #

unregisterModule :: String -> LB () Source #

registerServer :: String -> Server st -> ModuleT st LB () Source #

unregisterServer :: String -> ModuleT mod LB () Source #

applyOutputFilters :: Nick -> String -> LB [String] Source #

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

Interpret an expression in the context of a module.

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

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

listModules :: LB [String] Source #

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

Interpret a function in the context of all modules