| Safe Haskell | Safe-Inferred |
|---|
Network.IRC.Base
Description
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 = ByteStringSource
type ServerName = ByteStringSource
type UserName = ByteStringSource
type RealName = ByteStringSource
type Command = ByteStringSource
IRC Datatypes
The optional beginning of an IRC messages
Constructors
| Server ServerName | Server Prefix |
| NickName ByteString (Maybe UserName) (Maybe ServerName) | Nickname Prefix |
IRC messages are parsed as:
[ : prefix space ] command { space param } crlf
Constructors
| Message | |
Fields
| |
Formatting functions
encode :: Message -> ByteStringSource
Encode a message to its string representation
showPrefix :: Prefix -> ByteStringSource
showParameters :: [Parameter] -> ByteStringSource
Arguments
| :: 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 -> ByteStringSource
This is the deprecated version of encode