email-header-0.4.1: Parsing and rendering of email and MIME headers

Safe HaskellNone
LanguageHaskell98

Network.Email.Header.Parser

Contents

Description

Header parsers. Most exported parsers (with the exception of fws, cfws, and unstructured) are for parsing structured header fields. They expect no leading space and will eat an trailing white space.

Synopsis

Whitespace

fws :: Parser () Source #

Skip folding whitespace.

cfws :: Parser () Source #

Skip any comments or folding whitespace.

Combinators

lexeme :: Parser a -> Parser a Source #

Parse a value followed by whitespace.

symbol :: Char -> Parser Char Source #

Parse a character followed by whitespace.

commaSep :: Parser a -> Parser [a] Source #

Parse a list of elements, separated by commas.

Date and time

dateTime :: Parser ZonedTime Source #

Parse a date and time. TODO: non-numeric timezones (such as "PDT") are considered equivalent to UTC time.

Addresses

address :: Parser Address Source #

Parse an email address.

mailboxList :: Parser [Mailbox] Source #

Parse a list of Mailboxes.

Message IDs

messageID :: Parser MessageID Source #

Parse a message identifier.

messageIDList :: Parser [MessageID] Source #

Parse a list of message identifiers.

Text

phrase :: Parser Text Source #

Parse a phrase. Adjacent encoded words are concatenated. White space is reduced to a single space, except when quoted or part of an encoded word.

phraseList :: Parser [Text] Source #

Parse a comma-separated list of phrases.

unstructured :: Parser Text Source #

Parse unstructured text. Adjacent encoded words are concatenated. White space is reduced to a single space, except when part of an encoded word.

MIME

mimeVersion :: Parser (Int, Int) Source #

Parse the MIME version (which should be 1.0).

contentType :: Parser (MimeType, Parameters) Source #

Parse the content type.

contentTransferEncoding :: Parser (CI ByteString) Source #

Parse the content transfer encoding.