1 definition module IRCBot
3 from IRC import :: IRCMessage
4 from Data.Maybe import :: Maybe
5 from Data.Error import :: MaybeErrorString, :: MaybeError
10 * param: Hostname and port
11 * param: Startup commands that are sent initially. For example:
12 * [NICK "clooglebot" Nothing
13 * ,USER "cloogle" "0" "Cloogle bot"
14 * ,JOIN [("#cloogle",Nothing)]]
15 * param: Shutdown commands. For example
17 * param: Processing function
18 * param: command received by the server
21 * return: Maybe a response, the updated state and the updated world
22 * If the response is nothing the connection is closed
23 * All items in the list are sent back
25 * return: Maybe an error, the state and the new world
27 bot :: (String, Int) [IRCMessage] [IRCMessage] .a (IRCMessage -> (.a -> *(*World -> *(Maybe [IRCMessage], .a, *World)))) !*World -> *(Maybe String, .a, !*World)