-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Fast Internet Relay Chat (IRC) library -- -- Fast Internet Relay Chat (IRC) library. This library implements a -- attoparsec-based fast parser for IRC messages as well as a (currently -- yet nonexistent) network manager for servers and clients. @package fastirc @version 0.1.2 -- | Utility functions for parsing IRC messages. module Network.FastIRC.Utils -- | Character predicate for channel names. isChannelChar :: Char -> Bool -- | Character predicate for channel passwords. isChanPwdChar :: Char -> Bool -- | Character predicate for IRC commands. isCommandChar :: Char -> Bool -- | Character predicate for IRC user hostnames. In the string -- x!y@z the substring z is the user's hostname. isHostChar :: Char -> Bool -- | Character predicate for IRC end of line characters. isIRCEOLChar :: Char -> Bool -- | Character predicate for IRC tokens. isIRCTokChar :: Char -> Bool -- | Character predicate for IRC messages. isMessageChar :: Char -> Bool -- | Character predicate for IRC nicknames. This function considers high -- bytes (0x80 to 0xFF) and most nonstandard ASCII bytes as valid, -- because most modern IRC daemons allow nonstandard nicknames. isNickChar :: Char -> Bool -- | Character predicate for IRC servers. isServerChar :: Char -> Bool -- | Character predicate for IRC usernames. In the string x!y@z -- the substring y is the user's username. isUserChar :: Char -> Bool -- | Character predicate for nicknames, usernames and hostnames. isUserSpecChar :: Char -> Bool -- | Run a parser completely. parseComplete :: Parser a -> ByteString -> Maybe a -- | A number of convenient type aliases. module Network.FastIRC.Types type ChannelKey = ByteString type ChannelName = ByteString type CommandArg = ByteString type CommandName = ByteString type HostName = ByteString type MsgString = ByteString type NickName = ByteString type ServerName = ByteString type UserName = ByteString -- | Functions for dealing with sets of IRC servers. Note that servers are -- compared case-insensitively. module Network.FastIRC.ServerSet -- | A set of servers. This data type uses Set internally, but the -- strings are handled case-insensitively. data ServerSet -- | Add a server to a ServerSet. addServer :: ServerName -> ServerSet -> ServerSet -- | Remove a server from a ServerSet. delServer :: ServerName -> ServerSet -> ServerSet -- | Empty set of servers. emptyServers :: ServerSet -- | Check whether specified server is in the set. isServer :: ServerName -> ServerSet -> Bool -- | Build from list. serversFromList :: [ServerName] -> ServerSet -- | Convert to list. serversToList :: ServerSet -> [ServerName] -- | This module includes parsers for IRC users. module Network.FastIRC.Users -- | IRC user or server. data UserSpec -- | Nickname. Nick :: NickName -> UserSpec -- | Nickname, username and hostname. User :: NickName -> UserName -> HostName -> UserSpec -- | IRC server. Server :: ServerName -> UserSpec -- | Turn a UserSpec into a ByteString in a format suitable -- to be sent to the IRC server. showUserSpec :: UserSpec -> MsgString -- | A Parser for IRC users and servers. userParser :: ServerSet -> Parser UserSpec instance Eq UserSpec instance Read UserSpec instance Show UserSpec -- | This module implements the IRC monad, which you can use to -- write IRC applications. -- -- This module is completely useless for now. module Network.FastIRC.Session -- | Session configuration. data Config Config :: ServerSet -> Config cfgServers :: Config -> ServerSet -- | Monad for IRC sessions. type IRC = StateT Config IO -- | Parser and printer for IRC messages. module Network.FastIRC.Messages -- | Data type for IRC messages. data Message Message :: !Maybe UserSpec -> !Command -> Message -- | Message origin (user/server). msgOrigin :: Message -> !Maybe UserSpec -- | Message command or numeric. msgCommand :: Message -> !Command -- | Parser for IRC messages. messageParser :: ServerSet -> Parser Message -- | Run the messageParser parser. readMessage :: ServerSet -> MsgString -> Maybe Message -- | Turn a Message into a ByteString. It will already -- contain "\r\n" and can be sent as is to the IRC server. showMessage :: Message -> MsgString -- | Data type for IRC commands. data Command -- | Arbitrary string command. StringCmd :: CommandName -> [CommandArg] -> Command -- | Arbitrary numeric command. NumericCmd :: Integer -> [CommandArg] -> Command -- | Join command with a list of channels as well as channel keys. JoinCmd :: (Map ChannelName (Maybe ChannelKey)) -> Command -- | Parser for IRC commands and their arguments. commandParser :: Parser Command -- | Turn a Command into a ByteString. Please note that a -- command does not contain an origin specification. You should use -- showMessage to format a an IRC message to be sent to the -- server. showCommand :: Command -> MsgString instance Eq Command instance Show Command instance Eq Message instance Show Message -- | Fast IRC parsing and connection library. module Network.FastIRC