irc-0.2.1: A small library for parsing IRC messages.

Network.IRC.Types

Contents

Description

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

Synopsis

Type Synonyms

Properties

class Prop a whereSource

Property class

Methods

renderProp :: a -> StringSource

data Mode p whereSource

IRC Modes

Constructors

Add :: Prop p => [p] -> Mode p 
Remove :: Prop p => [p] -> Mode p 

Instances

Show p => Show (Mode p) 

data UserProp Source

User properties

IRC Datatypes

data Prefix Source

The optional beginning of an IRC messages

Constructors

Server ServerName

Server Prefix

NickName String (Maybe UserName) (Maybe ServerName)

Nickname Prefix

Instances

data Message Source

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

Constructors

Message (Maybe Prefix) Command [Parameter]

IRC Message

Instances

Formatting functions

renderSource

Arguments

:: Message

IRC Message

-> String

Rendered message

Message rendering

translateReplySource

Arguments

:: Command

Reply

-> String

Text translation

Translate a reply into the text version of the reply. If no text version is available, the argument is returned.