úÎçÊ  None24B 2The Config struct represents the Irc configuration ‡The Irc monad is an IO monad wrapped by a readerT, which contains the bot's immutable state (Rule, socket connection, and config)PSet up actions to run on start and end, and run the main loop. as an example: ÿHmain :: IO () main = mainWithConfigAndBehavior (Config "irc.freenode.org" 6667 "#yunbot-testing" "yunbot") $ do "!echo " |! return . drop 6 "!reverse " |! return . reverse . drop 9 6Connect to the server and return the initial bot state lWe're in the Irc monad now, so we've connected successfully Join a channel, and start processing commands !Process each line from the serverDispatch a command+Send a privmsg to the current chan + server=Send a message out to the server we're currently connected to Convenience.1modHeadRule modifies the first rule of a behaviorA"pattern" `modHeadRule` (\x -> x {pattern = (reverse.pattern) x}) ["nrettap"] 5(|!) is a infix API to add a rule to a Behavior monad,"pattern1" |! return >> "pattern2" |! return["pattern1","pattern2"]D"pattern1" |! return >> "pattern2" |! return >> "pattern3" |! return"["pattern1","pattern2","pattern3"])   !"#$ %&'(%   !"#$    !"#$ %&'( None   )      !"#$%&' Irc-0.1.0.2Irc Irc.InternalBehavior BehaviorMConfigserverportchannickmainWithConfigAndBehavior|!connectrunlistenevalprivmsgwriteio modHeadRule unBehaviorMRulepatternactionActionPatternBotrulesconfigsocket findAction liftAction runBevhavioraddRule ruleAddAction$fShowBehaviorM$fIsStringBehaviorM$fIsStringRule $fDefaultRule