irc-0.6.1.1: A small library for parsing IRC messages.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.IRC.Base

Description

Datatypes for representing IRC messages, as well as formatting them.

Synopsis

Type Synonyms

IRC Datatypes

data Prefix Source #

The optional beginning of an IRC messages

Constructors

Server ServerName

Server Prefix

NickName ByteString (Maybe UserName) (Maybe ServerName)

Nickname Prefix

Instances

Instances details
Read Prefix Source # 
Instance details

Defined in Network.IRC.Base

Show Prefix Source # 
Instance details

Defined in Network.IRC.Base

Eq Prefix Source # 
Instance details

Defined in Network.IRC.Base

Methods

(==) :: Prefix -> Prefix -> Bool #

(/=) :: Prefix -> Prefix -> Bool #

data Message Source #

IRC messages are parsed as: [ : prefix space ] command { space param } crlf

Instances

Instances details
Read Message Source # 
Instance details

Defined in Network.IRC.Base

Show Message Source # 
Instance details

Defined in Network.IRC.Base

Eq Message Source # 
Instance details

Defined in Network.IRC.Base

Methods

(==) :: Message -> Message -> Bool #

(/=) :: Message -> Message -> Bool #

Formatting functions

encode :: Message -> ByteString Source #

Encode a message to its string representation

translateReply Source #

Arguments

:: Command

Reply

-> ByteString

Text translation

Translate a reply into its text description. If no text is available, the argument is returned.

Deprecated

render :: Message -> ByteString Source #

This is the deprecated version of encode