lambdabot-core-5.3.0.1: Lambdabot core functionality

Safe HaskellNone
LanguageHaskell98

Lambdabot.Monad

Synopsis

Documentation

data IRCRState Source #

Global read-only 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
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
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 #

fail :: String -> 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 #

MonadIO LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

liftIO :: IO a -> LB a #

MonadThrow LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

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

MonadCatch LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

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

MonadMask LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

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

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

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

MonadException LB Source # 
Instance details

Defined in Lambdabot.Monad

Methods

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

MonadRandom LB Source # 
Instance details

Defined in Lambdabot.Bot

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

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 α #

MonadBaseControl IO LB Source # 
Instance details

Defined in Lambdabot.Monad

Associated Types

type StM LB a :: Type #

Methods

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

restoreM :: StM LB a -> LB a #

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

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
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 #

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 #

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

Interpret a function in the context of all modules