lambdabot- Lambdabot is a development tool and advanced IRC bot

Safe HaskellNone




data DSum tag where

A basic dependent sum type; the first component is a tag that specifies the type of the second; for example, think of a GADT such as:

 data Tag a where
    AString :: Tag String
    AnInt   :: Tag Int

Then, we have the following valid expressions of type DSum Tag:

 AString :=> "hello!"
 AnInt   :=> 42

And we can write functions that consume DSum Tag values by matching, such as:

 toString :: DSum Tag -> String
 toString (AString :=> str) = str
 toString (AnInt   :=> int) = show int

By analogy to the (key => value) construction for dictionary entries in many dynamic languages, we use (key :=> value) as the constructor for dependent sums. The :=> operator has very low precedence and binds to the right, so if the Tag GADT is extended with an additional constructor Rec :: Tag (DSum Tag), then Rec :=> AnInt :=> 3 + 4 is parsed as would be expected (Rec :=> (AnInt :=> (3 + 4))) and has type DSum Tag. Its precedence is just above that of $, so foo bar $ AString :=> eep is equivalent to foo bar (AString :=> eep).


:=> :: !(tag a) -> a -> DSum tag 


EqTag tag => Eq (DSum tag) 
OrdTag tag => Ord (DSum tag) 
ReadTag tag => Read (DSum tag) 
ShowTag tag => Show (DSum tag) 
Typeable1 t => Typeable (DSum t) 

lambdabotMain :: LB () -> [DSum Config] -> IO ExitCodeSource

The Lambdabot entry point. Initialise plugins, connect, and run the bot in the LB monad

Also, handle any fatal exceptions (such as non-recoverable signals), (i.e. print a message and exit). Non-fatal exceptions should be dealt with in the mainLoop or further down.

type Modules = LB ()Source

data Priority

Priorities are used to define how important a log message is. Users can filter log messages based on priorities.

These have their roots on the traditional syslog system. The standard definitions are given below, but you are free to interpret them however you like. They are listed here in ascending importance order.



Debug messages




Normal runtime conditions


General Warnings


General Errors


Severe situations


Take immediate action


System is unusable