-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A small library for parsing IRC messages. -- -- A set of combinators and types for parsing IRC messages. @package irc @version 0.2.1 -- | Datatypes for representing IRC messages, as well as formatting them. module Network.IRC.Types type Parameter = String type ServerName = String type UserName = String type RealName = String type Command = String -- | Property class class Prop a renderProp :: (Prop a) => a -> String -- | IRC Modes data Mode p Add :: [p] -> Mode p Remove :: [p] -> Mode p -- | User properties data UserProp UserOp :: UserProp Invisible :: UserProp ServerNotices :: UserProp Wallops :: UserProp -- | Channel properties data ChanProp ChanOp :: ChanProp Private :: ChanProp Secret :: ChanProp InviteOnly :: ChanProp TopicOpOnly :: ChanProp NoOutsideMessages :: ChanProp Moderated :: ChanProp UserLimit :: ChanProp BanMask :: ChanProp Speak :: ChanProp Password :: ChanProp -- | The optional beginning of an IRC messages data Prefix -- | Server Prefix Server :: ServerName -> Prefix -- | Nickname Prefix NickName :: String -> (Maybe UserName) -> (Maybe ServerName) -> Prefix -- | IRC messages are parsed as: [ : prefix space ] command { -- space param } crlf data Message -- | IRC Message Message :: (Maybe Prefix) -> Command -> [Parameter] -> Message -- | Message rendering render :: Message -> String renderMode :: (Prop p) => Mode p -> String -- | Translate a reply into the text version of the reply. If no text -- version is available, the argument is returned. translateReply :: Command -> String instance Show ChanProp instance Eq ChanProp instance Show UserProp instance Eq UserProp instance Show Prefix instance Show Message instance Prop ChanProp instance Prop UserProp instance (Show p) => Show (Mode p) -- | Parsec parsers and a general parsing interface for IRC messages module Network.IRC.Parser -- | Parse a String into a Message. parseMessage :: String -> Maybe Message -- | Parse a Prefix prefix :: CharParser st Prefix -- | Parse a Server prefix serverPrefix :: CharParser st Prefix -- | Parse a NickName prefix nicknamePrefix :: CharParser st Prefix -- | Parse a command. Either a string of capital letters, or 3 digits. command :: CharParser st Command -- | Parse a command parameter. parameter :: CharParser st Parameter -- | Parse a Message message :: CharParser st Message -- | Parse a cr lf crlf :: CharParser st () -- | Consume only spaces tabs or the bell character spaces :: CharParser st () -- | Convert a parser into an optional one that returns a Maybe maybeP :: GenParser tok st a -> GenParser tok st (Maybe a) -- | Convert a parser that consumes all space after it tokenize :: CharParser st a -> CharParser st a -- | Take all tokens until one character from a given string is found takeUntil :: String -> CharParser st String -- | library for parsing IRC messages module Network.IRC