Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Datatypes for representing IRC messages, as well as formatting them.
- type Parameter = ByteString
- type ServerName = ByteString
- type UserName = ByteString
- type RealName = ByteString
- type Command = ByteString
- data Prefix
- data Message = Message {
- msg_prefix :: Maybe Prefix
- msg_command :: Command
- msg_params :: [Parameter]
- encode :: Message -> ByteString
- showMessage :: Message -> ByteString
- showPrefix :: Prefix -> ByteString
- showParameters :: [Parameter] -> ByteString
- translateReply :: Command -> ByteString
- replyTable :: [(ByteString, ByteString)]
- render :: Message -> ByteString
Type Synonyms
type Parameter = ByteString Source
type ServerName = ByteString Source
type UserName = ByteString Source
type RealName = ByteString Source
type Command = ByteString Source
IRC Datatypes
The optional beginning of an IRC messages
Server ServerName | Server Prefix |
NickName ByteString (Maybe UserName) (Maybe ServerName) | Nickname Prefix |
IRC messages are parsed as:
[ :
prefix space ] command { space param } crlf
Message | |
|
Formatting functions
encode :: Message -> ByteString Source
Encode a message to its string representation
showMessage :: Message -> ByteString Source
showPrefix :: Prefix -> ByteString Source
showParameters :: [Parameter] -> ByteString Source
:: Command | Reply |
-> ByteString | Text translation |
Translate a reply into its text description. If no text is available, the argument is returned.
replyTable :: [(ByteString, ByteString)] Source
Deprecated
render :: Message -> ByteString Source
This is the deprecated version of encode