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

Safe Haskell | Safe-Inferred

Network.IRC.Parser

Contents

- Parsing and Formatting Functions
- Parsec Combinators for Parsing IRC messages
- Other Parser Combinators
- Deprecated Functions

Description

Parsec parsers and a general parsing interface for IRC messages

Synopsis

- decode :: String -> Maybe Message
- prefix :: CharParser st Prefix
- serverPrefix :: CharParser st Prefix
- nicknamePrefix :: CharParser st Prefix
- command :: CharParser st Command
- parameter :: CharParser st Parameter
- message :: CharParser st Message
- crlf :: CharParser st ()
- spaces :: CharParser st ()
- tokenize :: CharParser st a -> CharParser st a
- takeUntil :: String -> CharParser st String
- parseMessage :: String -> Maybe Message

# Parsing and Formatting Functions

decode Source

Arguments

:: String | Message string
-> Maybe Message | Parsed message

Parse a String into a Message.

# Parsec Combinators for Parsing IRC messages

prefix :: CharParser st Prefix Source

Parse a Prefix

serverPrefix :: CharParser st Prefix Source

Parse a Server prefix

nicknamePrefix :: CharParser st Prefix Source

Parse a NickName prefix

command :: CharParser st Command Source

Parse a command. Either a string of capital letters, or 3 digits.

parameter :: CharParser st Parameter Source

Parse a command parameter.

message :: CharParser st Message Source

Parse a Message

crlf :: CharParser st ()Source

Parse a cr lf

spaces :: CharParser st ()Source

Consume only spaces tabs or the bell character

# Other Parser Combinators

tokenize :: CharParser st a -> CharParser st aSource

Convert a parser that consumes all space after it

takeUntil :: String -> CharParser st String Source

Take all tokens until one character from a given string is found

# Deprecated Functions

parseMessage :: String -> Maybe Message Source

The deprecated version of decode