Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Module st = Module {
- moduleSerialize :: !(Maybe (Serial st))
- moduleDefState :: !(LB st)
- moduleSticky :: !Bool
- moduleCmds :: !(ModuleT st LB [Command (ModuleT st LB)])
- moduleInit :: !(ModuleT st LB ())
- moduleExit :: !(ModuleT st LB ())
- contextual :: !(String -> Cmd (ModuleT st LB) ())
- data ModuleT st m a
- newModule :: Module st
- getModuleName :: Monad m => ModuleT mod m String
- bindModule0 :: ModuleT mod LB a -> ModuleT mod LB (LB a)
- bindModule1 :: (a -> ModuleT mod LB b) -> ModuleT mod LB (a -> LB b)
- bindModule2 :: (a -> b -> ModuleT mod LB c) -> ModuleT mod LB (a -> b -> LB c)
- data LB a
- class (MonadIO m, MonadBaseControl IO m, MonadConfig m, MonadLogging m, Applicative m) => MonadLB m where
- lim80 :: Monad m => m String -> Cmd m ()
- ios80 :: MonadIO m => IO String -> Cmd m ()
- data ChanName
- mkCN :: Nick -> ChanName
- getCN :: ChanName -> Nick
- data Nick = Nick {}
- ircPrivmsg :: Nick -> String -> LB ()
- module Lambdabot.Config
- commandPrefixes :: Config [String]
- disabledCommands :: Config [String]
- editDistanceLimit :: Config Int
- enableInsults :: Config Bool
- onStartupCmds :: Config [String]
- outputDir :: Config FilePath
- uncaughtExceptionHandler :: Config (SomeException -> IO ())
- replaceRootLogger :: Config Bool
- lbRootLoggerPath :: Config [String]
- consoleLogHandle :: Config Handle
- consoleLogLevel :: Config Priority
- consoleLogFormat :: Config String
- module Lambdabot.Command
- module Lambdabot.State
- module Lambdabot.File
- data Serial s = Serial {
- serialize :: s -> Maybe ByteString
- deserialize :: ByteString -> Maybe s
- stdSerial :: (Show s, Read s) => Serial s
- mapSerial :: (Ord k, Show k, Show v, Read k, Read v) => Serial (Map k v)
- mapPackedSerial :: Serial (Map ByteString ByteString)
- assocListPackedSerial :: Serial [(ByteString, ByteString)]
- mapListPackedSerial :: Serial (Map ByteString [ByteString])
- readM :: (Monad m, Read a) => String -> m a
- class Packable t where
- readPacked :: ByteString -> t
- showPacked :: t -> ByteString
- readOnly :: (ByteString -> b) -> Serial b
Documentation
The Module type class.
Module | |
|
This transformer encodes the additional information a module might need to access its name or its state.
MonadBase b m => MonadBase b (ModuleT st m) | |
MonadBaseControl b m => MonadBaseControl b (ModuleT st m) | |
MonadTrans (ModuleT st) | |
MonadTransControl (ModuleT st) | |
Monad m => Monad (ModuleT st m) | |
Functor m => Functor (ModuleT st m) | |
Applicative m => Applicative (ModuleT st m) | |
MonadIO m => MonadIO (ModuleT st m) | |
MonadException m => MonadException (ModuleT st m) | |
MonadConfig m => MonadConfig (ModuleT st m) | |
MonadLogging m => MonadLogging (ModuleT st m) | |
MonadLB m => MonadLB (ModuleT st m) | |
MonadLB m => MonadLBState (ModuleT st m) | |
data StT (ModuleT st) = StModule {
| |
data StM (ModuleT st m) = StMModule {
| |
type LBState (ModuleT st m) = st |
getModuleName :: Monad m => ModuleT mod m String Source
bindModule0 :: ModuleT mod LB a -> ModuleT mod LB (LB a) Source
bind an action to the current module so it can be run from the plain
LB
monad.
bindModule1 :: (a -> ModuleT mod LB b) -> ModuleT mod LB (a -> LB b) Source
variant of bindModule0
for monad actions with one argument
bindModule2 :: (a -> b -> ModuleT mod LB c) -> ModuleT mod LB (a -> b -> LB c) Source
variant of bindModule0
for monad actions with two arguments
The IRC Monad. The reader transformer holds information about the connection to the IRC server.
instances Monad, Functor, MonadIO, MonadState, MonadError
class (MonadIO m, MonadBaseControl IO m, MonadConfig m, MonadLogging m, Applicative m) => MonadLB m where Source
ios80 :: MonadIO m => IO String -> Cmd m () Source
convenience, similar to ios but also cut output to channel to 80 characters
usage: process _ _ to _ s = ios80 to (plugs s)
The type of nicknames isolated from a message.
Send a message to a channel/user. If the message is too long, the rest of it is saved in the (global) more-state.
module Lambdabot.Config
onStartupCmds :: Config [String] Source
uncaughtExceptionHandler :: Config (SomeException -> IO ()) Source
module Lambdabot.Command
module Lambdabot.State
module Lambdabot.File
Serial | |
|
mapSerial :: (Ord k, Show k, Show v, Read k, Read v) => Serial (Map k v) Source
Serializes a Map
type if both the key and the value are instances
of Read and Show. The serialization is done by converting the map to
and from lists. Results are saved line-wise, for better editing and
revison control.
readM :: (Monad m, Read a) => String -> m a Source
readM
behaves like read, but catches failure in a monad.
this allocates a 20-30 M on startup...
readPacked :: ByteString -> t Source
showPacked :: t -> ByteString Source
Packable [(ByteString, ByteString)] | |
Packable (Map ByteString [ByteString]) | An instance for Map Packed [Packed] uses gzip compression |
Packable (Map ByteString (Bool, [(String, Int)])) | |
Packable (Map ByteString ByteString) |
readOnly :: (ByteString -> b) -> Serial b Source