-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Parsec parsers for the Internet Message format (e-mail)
--   
--   Parsec parsers for the Internet Message format defined in RFC2822.
@package hsemail
@version 2.2.0

-- | This module provides parsers for the grammar defined in RFC2234,
--   "Augmented BNF for Syntax Specifications: ABNF",
--   http://www.faqs.org/rfcs/rfc2234.html. The terminal called
--   char in the RFC is called character here to avoid
--   conflicts with Parsec's char function.
module Text.Parsec.Rfc2234

-- | Case-insensitive variant of Parsec's char function.
caseChar :: Stream s m Char => Char -> ParsecT s u m Char

-- | Case-insensitive variant of Parsec's string function.
caseString :: Stream s m Char => String -> ParsecT s u m ()

-- | Match a parser at least n times.
manyN :: Int -> ParsecT s u m a -> ParsecT s u m [a]

-- | Match a parser at least n times, but no more than m
--   times.
manyNtoM :: Int -> Int -> ParsecT s u m a -> ParsecT s u m [a]

-- | Match any character of the alphabet.
alpha :: Stream s m Char => ParsecT s u m Char

-- | Match either "1" or "0".
bit :: Stream s m Char => ParsecT s u m Char

-- | Match any 7-bit US-ASCII character except for NUL (ASCII value 0, that
--   is).
character :: Stream s m Char => ParsecT s u m Char

-- | Match the carriage return character \r.
cr :: Stream s m Char => ParsecT s u m Char

-- | Match returns the linefeed character \n.
lf :: Stream s m Char => ParsecT s u m Char

-- | Match the Internet newline \r\n.
crlf :: Stream s m Char => ParsecT s u m String

-- | Match any US-ASCII control character. That is any character with a
--   decimal value in the range of [0..31,127].
ctl :: Stream s m Char => ParsecT s u m Char

-- | Match the double quote character """.
dquote :: Stream s m Char => ParsecT s u m Char

-- | Match any character that is valid in a hexadecimal number; ['0'..'9']
--   and ['A'..'F','a'..'f'] that is.
hexdig :: Stream s m Char => ParsecT s u m Char

-- | Match the tab ("\t") character.
htab :: Stream s m Char => ParsecT s u m Char

-- | Match "linear white-space". That is any number of consecutive
--   wsp, optionally followed by a crlf and (at least) one
--   more wsp.
lwsp :: Stream s m Char => ParsecT s u m String

-- | Match any character.
octet :: Stream s m Char => ParsecT s u m Char

-- | Match the space.
sp :: Stream s m Char => ParsecT s u m Char

-- | Match any printable ASCII character. (The "v" stands for "visible".)
--   That is any character in the decimal range of [33..126].
vchar :: Stream s m Char => ParsecT s u m Char

-- | Match either sp or htab.
wsp :: Stream s m Char => ParsecT s u m Char

-- | Match a "quoted pair". Any characters (excluding CR and LF) may be
--   quoted.
quoted_pair :: Stream s m Char => ParsecT s u m String

-- | Match a quoted string. The specials "\" and """ must
--   be escaped inside a quoted string; CR and LF are not allowed at all.
quoted_string :: Stream s m Char => ParsecT s u m String

-- | This module provides parsers for the grammar defined in RFC2822,
--   "Internet Message Format",
--   http://www.faqs.org/rfcs/rfc2822.html.
module Text.Parsec.Rfc2822

-- | Return Nothing if the given parser doesn't match. This
--   combinator is included in the latest parsec distribution as
--   optionMaybe, but ghc-6.6.1 apparently doesn't have it.
maybeOption :: Stream s m Char => ParsecT s u m a -> ParsecT s u m (Maybe a)

-- | unfold = between (optional cfws) (optional
--   cfws)
unfold :: Stream s m Char => ParsecT s u m a -> ParsecT s u m a

-- | Construct a parser for a message header line from the header's name
--   and a parser for the body.
header :: Stream s m Char => String -> ParsecT s u m a -> ParsecT s u m a

-- | Like header, but allows the obsolete white-space rules.
obs_header :: Stream s m Char => String -> ParsecT s u m a -> ParsecT s u m a

-- | Match any US-ASCII non-whitespace control character.
no_ws_ctl :: Stream s m Char => ParsecT s u m Char

-- | Match any US-ASCII character except for r, n.
text :: Stream s m Char => ParsecT s u m Char

-- | Match any of the RFC's "special" characters:
--   ()<>[]:;@,.\".
specials :: Stream s m Char => ParsecT s u m Char

-- | Match a "quoted pair". All characters matched by text may be
--   quoted. Note that the parsers returns both characters, the
--   backslash and the actual content.
quoted_pair :: Stream s m Char => ParsecT s u m String

-- | Match "folding whitespace". That is any combination of wsp and
--   crlf followed by wsp.
fws :: Stream s m Char => ParsecT s u m String

-- | Match any non-whitespace, non-control character except for
--   "(", ")", and "\". This is used to describe
--   the legal content of comments.
--   
--   Note: This parser accepts 8-bit characters, even though this is
--   not legal according to the RFC. Unfortunately, 8-bit content in
--   comments has become fairly common in the real world, so we'll just
--   accept the fact.
ctext :: Stream s m Char => ParsecT s u m Char

-- | Match a "comments". That is any combination of ctext,
--   quoted_pairs, and fws between brackets. Comments may
--   nest.
comment :: Stream s m Char => ParsecT s u m String

-- | Match any combination of fws and comments.
cfws :: Stream s m Char => ParsecT s u m String

-- | Match any US-ASCII character except for control characters,
--   specials, or space. atom and dot_atom are made up
--   of this.
atext :: Stream s m Char => ParsecT s u m Char

-- | Match one or more atext characters and skip any preceding or
--   trailing cfws.
atom :: Stream s m Char => ParsecT s u m String

-- | Match dot_atom_text and skip any preceding or trailing
--   cfws.
dot_atom :: Stream s m Char => ParsecT s u m String

-- | Match two or more atexts interspersed by dots.
dot_atom_text :: Stream s m Char => ParsecT s u m String

-- | Match any non-whitespace, non-control US-ASCII character except for
--   "\" and """.
qtext :: Stream s m Char => ParsecT s u m Char

-- | Match either qtext or quoted_pair.
qcontent :: Stream s m Char => ParsecT s u m String

-- | Match any number of qcontent between double quotes. Any
--   cfws preceding or following the "atom" is skipped
--   automatically.
quoted_string :: Stream s m Char => ParsecT s u m String

-- | Match either atom or quoted_string.
word :: Stream s m Char => ParsecT s u m String

-- | Match either one or more words or an obs_phrase.
phrase :: Stream s m Char => ParsecT s u m [String]

-- | Match any non-whitespace, non-control US-ASCII character except for
--   "\" and """.
utext :: Stream s m Char => ParsecT s u m Char

-- | Match any number of utext tokens.
--   
--   "Unstructured text" is used in free text fields such as
--   subject. Please note that any comments or whitespace that
--   prefaces or follows the actual utext is included in the
--   returned string.
unstructured :: Stream s m Char => ParsecT s u m String

-- | Parse a date and time specification of the form
--   
--   
--   Thu, 19 Dec 2002 20:35:46 +0200
--   
--   
--   where the weekday specification "Thu," is optional. The
--   parser returns an appropriate ZonedTime
--   
--   TODO: Nor will the date_time parser perform any
--   consistency checking. It will accept
--   
--   
--   >>> parseTest date_time "Wed, 30 Apr 2002 13:12 +0100"
--   2002-04-30 13:12:00 +0100
--   
date_time :: Stream s m Char => ParsecT s u m ZonedTime

-- | This parser matches a day_name or an obs_day_of_week
--   (optionally wrapped in folding whitespace) and return the appropriate
--   DayOfWeek value.
day_of_week :: Stream s m Char => ParsecT s u m DayOfWeek

-- | This parser recognizes abbreviated weekday names ("Mon",
--   "Tue",...).
day_name :: Stream s m Char => ParsecT s u m DayOfWeek

-- | This parser will match a date of the form "dd:mm:yyyy" and
--   return a tripple of the form (Int,Month,Int) - corresponding to
--   (year,month,day).
date :: Stream s m Char => ParsecT s u m Day

-- | This parser will match a four digit number and return its integer
--   value. No range checking is performed.
year :: Stream s m Char => ParsecT s u m Int

-- | This parser will match a month_name, optionally wrapped in
--   folding whitespace, or an obs_month and return its
--   Month value.
month :: Stream s m Char => ParsecT s u m Int

-- | This parser will the abbreviated month names ("Jan",
--   "Feb", ...) and return the appropriate Int value in
--   the range of (1,12).
month_name :: Stream s m Char => ParsecT s u m Int
day_of_month :: Stream s m Char => ParsecT s u m Int

-- | Match a 1 or 2-digit number (day of month), recognizing both standard
--   and obsolete folding syntax.
day :: Stream s m Char => ParsecT s u m Int

-- | This parser will match a time_of_day specification followed by
--   a zone. It returns the tuple (TimeOfDay,Int) corresponding to
--   the return values of either parser.
time :: Stream s m Char => ParsecT s u m (TimeOfDay, TimeZone)

-- | This parser will match a time-of-day specification of "hh:mm"
--   or "hh:mm:ss" and return the corrsponding time as a
--   TimeOfDay.
--   
--   
--   >>> parseTest (time_of_day <* eof) "12:03:23"
--   12:03:23
--   
--   >>> parseTest (time_of_day <* eof) "99:99:99"
--   parse error at (line 1, column 3):unknown parse error
--   
time_of_day :: Stream s m Char => ParsecT s u m TimeOfDay

-- | This parser matches a two-digit number in the range (0,24) and returns
--   its integer value.
--   
--   
--   >>> parseTest hour "034"
--   3
--   
--   >>> parseTest hour "99"
--   parse error at (line 1, column 3):unknown parse error
--   
hour :: Stream s m Char => ParsecT s u m Int

-- | This parser will match a two-digit number in the range (0,60) and
--   return its integer value.
--   
--   
--   >>> parseTest minute "34"
--   34
--   
--   >>> parseTest minute "61"
--   parse error at (line 1, column 3):unknown parse error
--   
--   >>> parseTest (minute <* eof) "034"
--   parse error at (line 1, column 3):
--   unexpected '4'
--   expecting end of input
--   
minute :: Stream s m Char => ParsecT s u m Int

-- | This parser will match a two-digit number in the range (0,60) and
--   return its integer value.
--   
--   
--   >>> parseTest second "34"
--   34
--   
second :: Stream s m Char => ParsecT s u m Int

-- | This parser will match a timezone specification of the form
--   "+hhmm" or "-hhmm" and return the zone's offset to
--   UTC in seconds as an integer. obs_zone is matched as well.
zone :: Stream s m Char => ParsecT s u m TimeZone

-- | A NameAddr is composed of an optional realname a mandatory e-mail
--   address.
data NameAddr
NameAddr :: Maybe String -> String -> NameAddr
[nameAddr_name] :: NameAddr -> Maybe String
[nameAddr_addr] :: NameAddr -> String

-- | Parse a single mailbox or an address group and return
--   the address(es).
address :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a name_addr or an addr_spec and return the
--   address.
mailbox :: Stream s m Char => ParsecT s u m NameAddr

-- | Parse an angle_addr, optionally prefaced with a
--   display_name, and return the address.
name_addr :: Stream s m Char => ParsecT s u m NameAddr

-- | Parse an angle_addr or an obs_angle_addr and return the
--   address.
angle_addr :: Stream s m Char => ParsecT s u m String

-- | Parse a "group" of addresses. That is a display_name, followed
--   by a colon, optionally followed by a mailbox_list, followed by
--   a semicolon. The found address(es) are returned - what may be none.
--   Here is an example:
--   
--   
--   >>> parse group "" "my group: user1@example.org, user2@example.org;"
--   Right [NameAddr {nameAddr_name = Nothing, nameAddr_addr = "user1@example.org"},NameAddr {nameAddr_name = Nothing, nameAddr_addr = "user2@example.org"}]
--   
group :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse and return a phrase.
display_name :: Stream s m Char => ParsecT s u m String

-- | Parse a list of mailbox addresses, every two addresses being
--   separated by a comma, and return the list of found address(es).
mailbox_list :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a list of address addresses, every two addresses being
--   separated by a comma, and return the list of found address(es).
address_list :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse an "address specification". That is a local_part,
--   followed by an "@" character, followed by a domain.
--   Return the complete address as String, ignoring any whitespace
--   or any comments.
addr_spec :: Stream s m Char => ParsecT s u m String

-- | Parse and return a "local part" of an addr_spec. That is either
--   a dot_atom or a quoted_string.
local_part :: Stream s m Char => ParsecT s u m String

-- | Parse and return a "domain part" of an addr_spec. That is
--   either a dot_atom or a domain_literal.
domain :: Stream s m Char => ParsecT s u m String

-- | Parse a "domain literal". That is a "[" character, followed
--   by any amount of dcontent, followed by a terminating
--   "]" character. The complete string is returned verbatim.
domain_literal :: Stream s m Char => ParsecT s u m String

-- | Parse and return any characters that are legal in a
--   domain_literal. That is dtext or a quoted_pair.
dcontent :: Stream s m Char => ParsecT s u m String

-- | Parse and return any ASCII characters except "[",
--   "]", and "\".
dtext :: Stream s m Char => ParsecT s u m Char

-- | This data type represents a parsed Internet Message as defined in this
--   RFC. It consists of an arbitrary number of header lines, represented
--   in the Field data type, and a message body, which may be empty.
data GenericMessage a
Message :: [Field] -> a -> GenericMessage a

-- | Parse a complete message as defined by this RFC and it broken down
--   into the separate header fields and the message body. Header lines,
--   which contain syntax errors, will not cause the parser to abort.
--   Rather, these headers will appear as OptionalFields (which are
--   unparsed) in the resulting Message. A message must be really,
--   really badly broken for this parser to fail.
--   
--   This behaviour was chosen because it is impossible to predict what the
--   user of this module considers to be a fatal error; traditionally,
--   parsers are very forgiving when it comes to Internet messages.
--   
--   If you want to implement a really strict parser, you'll have to put
--   the appropriate parser together yourself. You'll find that this is
--   rather easy to do. Refer to the fields parser for further
--   details.
message :: (Monoid s, Stream s m Char) => ParsecT s u m (GenericMessage s)

-- | A message body is just an unstructured sequence of characters.
body :: (Monoid s, Monad m) => ParsecT s u m s

-- | This data type represents any of the header fields defined in this
--   RFC. Each of the various instances contains with the return value of
--   the corresponding parser.
data Field
OptionalField :: String -> String -> Field
From :: [NameAddr] -> Field
Sender :: NameAddr -> Field
ReturnPath :: String -> Field
ReplyTo :: [NameAddr] -> Field
To :: [NameAddr] -> Field
Cc :: [NameAddr] -> Field
Bcc :: [NameAddr] -> Field
MessageID :: String -> Field
InReplyTo :: [String] -> Field
References :: [String] -> Field
Subject :: String -> Field
Comments :: String -> Field
Keywords :: [[String]] -> Field
Date :: ZonedTime -> Field
ResentDate :: ZonedTime -> Field
ResentFrom :: [NameAddr] -> Field
ResentSender :: NameAddr -> Field
ResentTo :: [NameAddr] -> Field
ResentCc :: [NameAddr] -> Field
ResentBcc :: [NameAddr] -> Field
ResentMessageID :: String -> Field
ResentReplyTo :: [NameAddr] -> Field
Received :: ([(String, String)], ZonedTime) -> Field
ObsReceived :: [(String, String)] -> Field

-- | This parser will parse an arbitrary number of header fields as defined
--   in this RFC. For each field, an appropriate Field value is
--   created, all of them making up the Field list that this parser
--   returns.
--   
--   If you look at the implementation of this parser, you will find that
--   it uses Parsec's try modifier around all of the fields.
--   The idea behind this is that fields, which contain syntax errors, fall
--   back to the catch-all optional_field. Thus, this parser will
--   hardly ever return a syntax error -- what conforms with the idea that
--   any message that can possibly be accepted should be.
fields :: Stream s m Char => ParsecT s u m [Field]

-- | Parse a "Date:" header line and return the date it contains a
--   CalendarTime.
orig_date :: Stream s m Char => ParsecT s u m ZonedTime

-- | Parse a "From:" header line and return the
--   mailbox_list address(es) contained in it.
from :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a "Sender:" header line and return the mailbox
--   address contained in it.
sender :: Stream s m Char => ParsecT s u m NameAddr

-- | Parse a "Reply-To:" header line and return the
--   address_list address(es) contained in it.
reply_to :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a "To:" header line and return the address_list
--   address(es) contained in it.
to :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a "Cc:" header line and return the address_list
--   address(es) contained in it.
cc :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a "Bcc:" header line and return the address_list
--   address(es) contained in it.
bcc :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a "Message-Id:" header line and return the
--   msg_id contained in it.
message_id :: Stream s m Char => ParsecT s u m String

-- | Parse a "In-Reply-To:" header line and return the list of
--   msg_ids contained in it.
in_reply_to :: Stream s m Char => ParsecT s u m [String]

-- | Parse a "References:" header line and return the list of
--   msg_ids contained in it.
references :: Stream s m Char => ParsecT s u m [String]

-- | Parse a "message ID:" and return it. A message ID is almost
--   identical to an angle_addr, but with stricter rules about
--   folding and whitespace.
msg_id :: Stream s m Char => ParsecT s u m String

-- | Parse a "left ID" part of a msg_id. This is almost identical to
--   the local_part of an e-mail address, but with stricter rules
--   about folding and whitespace.
id_left :: Stream s m Char => ParsecT s u m String

-- | Parse a "right ID" part of a msg_id. This is almost identical
--   to the domain of an e-mail address, but with stricter rules
--   about folding and whitespace.
id_right :: Stream s m Char => ParsecT s u m String

-- | Parse one or more occurrences of qtext or quoted_pair
--   and return the concatenated string. This makes up the id_left
--   of a msg_id.
no_fold_quote :: Stream s m Char => ParsecT s u m String

-- | Parse one or more occurrences of dtext or quoted_pair
--   and return the concatenated string. This makes up the id_right
--   of a msg_id.
no_fold_literal :: Stream s m Char => ParsecT s u m String

-- | Parse a "Subject:" header line and return its contents
--   verbatim. Please note that all whitespace and/or comments are
--   preserved, i.e. the result of parsing "Subject: foo" is "
--   foo", not "foo".
subject :: Stream s m Char => ParsecT s u m String

-- | Parse a "Comments:" header line and return its contents
--   verbatim. Please note that all whitespace and/or comments are
--   preserved, i.e. the result of parsing "Comments: foo" is
--   " foo", not "foo".
comments :: Stream s m Char => ParsecT s u m String

-- | Parse a "Keywords:" header line and return the list of
--   phrases found. Please not that each phrase is again a list of
--   atoms, as returned by the phrase parser.
keywords :: Stream s m Char => ParsecT s u m [[String]]

-- | Parse a "Resent-Date:" header line and return the date it
--   contains as ZonedTime.
resent_date :: Stream s m Char => ParsecT s u m ZonedTime

-- | Parse a "Resent-From:" header line and return the
--   mailbox_list address(es) contained in it.
resent_from :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a "Resent-Sender:" header line and return the
--   mailbox_list address(es) contained in it.
resent_sender :: Stream s m Char => ParsecT s u m NameAddr

-- | Parse a "Resent-To:" header line and return the
--   mailbox address contained in it.
resent_to :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a "Resent-Cc:" header line and return the
--   address_list address(es) contained in it.
resent_cc :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a "Resent-Bcc:" header line and return the
--   address_list address(es) contained in it. (This list may be
--   empty.)
resent_bcc :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a "Resent-Message-ID:" header line and return the
--   msg_id contained in it.
resent_msg_id :: Stream s m Char => ParsecT s u m String
return_path :: Stream s m Char => ParsecT s u m String
path :: Stream s m Char => ParsecT s u m String
received :: Stream s m Char => ParsecT s u m ([(String, String)], ZonedTime)
name_val_list :: Stream s m Char => ParsecT s u m [(String, String)]
name_val_pair :: Stream s m Char => ParsecT s u m (String, String)
item_name :: Stream s m Char => ParsecT s u m String
item_value :: Stream s m Char => ParsecT s u m String

-- | Parse an arbitrary header field and return a tuple containing the
--   field_name and unstructured text of the header. The name
--   will not contain the terminating colon.
optional_field :: Stream s m Char => ParsecT s u m (String, String)

-- | Parse and return an arbitrary header field name. That is one or more
--   ftext characters.
field_name :: Stream s m Char => ParsecT s u m String

-- | Match and return any ASCII character except for control characters,
--   whitespace, and ":".
ftext :: Stream s m Char => ParsecT s u m Char

-- | Match the obsolete "quoted pair" syntax, which - unlike
--   quoted_pair - allowed any ASCII character to be
--   specified when quoted. The parser will return both, the backslash and
--   the actual character.
obs_qp :: Stream s m Char => ParsecT s u m String

-- | Match the obsolete "text" syntax, which - unlike text - allowed
--   "carriage returns" and "linefeeds". This is really weird; you better
--   consult the RFC for details. The parser will return the complete
--   string, including those special characters.
obs_text :: Stream s m Char => ParsecT s u m String

-- | Match and return the obsolete "char" syntax, which - unlike
--   character - did not allow "carriage return" and "linefeed".
obs_char :: Stream s m Char => ParsecT s u m Char

-- | Match and return the obsolete "utext" syntax, which is identical to
--   obs_text.
obs_utext :: Stream s m Char => ParsecT s u m String

-- | Match the obsolete "phrase" syntax, which - unlike phrase -
--   allows dots between tokens.
obs_phrase :: Stream s m Char => ParsecT s u m [String]

-- | Match a "phrase list" syntax and return the list of Strings
--   that make up the phrase. In contrast to a phrase, the
--   obs_phrase_list separates the individual words by commas. This
--   syntax is - as you will have guessed - obsolete.
obs_phrase_list :: Stream s m Char => ParsecT s u m [String]

-- | Parse and return an "obsolete fws" token. That is at least one
--   wsp character, followed by an arbitrary number (including zero)
--   of crlf followed by at least one more wsp character.
obs_fws :: Stream s m Char => ParsecT s u m String

-- | Parse a day_name but allow for the obsolete folding syntax.
--   TODO
obs_day_of_week :: Stream s m Char => ParsecT s u m DayOfWeek

-- | Parse a year but allow for a two-digit number (obsolete) and
--   the obsolete folding syntax.
obs_year :: Stream s m Char => ParsecT s u m Int

-- | Parse a month_name but allow for the obsolete folding syntax.
obs_month :: Stream s m Char => ParsecT s u m Int

-- | Parse a day but allow for the obsolete folding syntax.
obs_day :: Stream s m Char => ParsecT s u m Int

-- | Parse a hour but allow for the obsolete folding syntax.
obs_hour :: Stream s m Char => ParsecT s u m Int

-- | Parse a minute but allow for the obsolete folding syntax.
obs_minute :: Stream s m Char => ParsecT s u m Int

-- | Parse a second but allow for the obsolete folding syntax.
obs_second :: Stream s m Char => ParsecT s u m Int

-- | Match the obsolete zone names and return the appropriate offset.
obs_zone :: Stream s m Char => ParsecT s u m TimeZone

-- | This parser matches the "obsolete angle address" syntax, a construct
--   that used to be called "route address" in earlier RFCs. It differs
--   from a standard angle_addr in two ways: (1) it allows far more
--   liberal insertion of folding whitespace and comments and (2) the
--   address may contain a "route" (which this parser ignores):
--   
--   
--   >>> parse obs_angle_addr "" "<@example1.org,@example2.org:joe@example.org>"
--   Right "<joe@example.org>"
--   
obs_angle_addr :: Stream s m Char => ParsecT s u m String

-- | This parser parses the "route" part of obs_angle_addr and
--   returns the list of Strings that make up this route. Relies on
--   obs_domain_list for the actual parsing.
obs_route :: Stream s m Char => ParsecT s u m [String]

-- | This parser parses a list of domain names, each of them prefaced with
--   an "at". Multiple names are separated by a comma. The list of
--   domains is returned - and may be empty.
obs_domain_list :: Stream s m Char => ParsecT s u m [String]

-- | Parse the obsolete syntax of a local_part, which allowed for
--   more liberal insertion of folding whitespace and comments. The actual
--   string is returned.
obs_local_part :: Stream s m Char => ParsecT s u m String

-- | Parse the obsolete syntax of a domain, which allowed for more
--   liberal insertion of folding whitespace and comments. The actual
--   string is returned.
obs_domain :: Stream s m Char => ParsecT s u m String

-- | This parser will match the obsolete syntax for a mailbox_list.
--   This one is quite weird: An obs_mbox_list contains an arbitrary
--   number of mailboxes - including none -, which are separated by
--   commas. But you may have multiple consecutive commas without giving a
--   mailbox. You may also have a valid obs_mbox_list that
--   contains no mailbox at all. On the other hand, you
--   must have at least one comma. The following example is valid:
--   
--   
--   >>> parse obs_mbox_list "" ","
--   Right []
--   
--   
--   But this one is not:
--   
--   
--   >>> parse obs_mbox_list "" "joe@example.org"
--   Left (line 1, column 16):
--   unexpected end of input
--   expecting obsolete syntax for a list of mailboxes
--   
obs_mbox_list :: Stream s m Char => ParsecT s u m [NameAddr]

-- | This parser is identical to obs_mbox_list but parses a list of
--   addresses rather than mailboxes. The main difference is
--   that an address may contain groups. Please note that as
--   of now, the parser will return a simple list of addresses; the
--   grouping information is lost.
obs_addr_list :: Stream s m Char => ParsecT s u m [NameAddr]
obs_fields :: Stream s m Char => ParsecT s u m [Field]

-- | Parse a date header line but allow for the obsolete folding
--   syntax.
obs_orig_date :: Stream s m Char => ParsecT s u m ZonedTime

-- | Parse a from header line but allow for the obsolete folding
--   syntax.
obs_from :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a sender header line but allow for the obsolete folding
--   syntax.
obs_sender :: Stream s m Char => ParsecT s u m NameAddr

-- | Parse a reply_to header line but allow for the obsolete folding
--   syntax.
obs_reply_to :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a to header line but allow for the obsolete folding
--   syntax.
obs_to :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a cc header line but allow for the obsolete folding
--   syntax.
obs_cc :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a bcc header line but allow for the obsolete folding
--   syntax.
obs_bcc :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a message_id header line but allow for the obsolete
--   folding syntax.
obs_message_id :: Stream s m Char => ParsecT s u m String

-- | Parse an in_reply_to header line but allow for the obsolete
--   folding and the obsolete phrase syntax.
obs_in_reply_to :: Stream s m Char => ParsecT s u m [String]

-- | Parse a references header line but allow for the obsolete
--   folding and the obsolete phrase syntax.
obs_references :: Stream s m Char => ParsecT s u m [String]

-- | Parses the "left part" of a message ID, but allows the obsolete
--   syntax, which is identical to a local_part.
obs_id_left :: Stream s m Char => ParsecT s u m String

-- | Parses the "right part" of a message ID, but allows the obsolete
--   syntax, which is identical to a domain.
obs_id_right :: Stream s m Char => ParsecT s u m String

-- | Parse a subject header line but allow for the obsolete folding
--   syntax.
obs_subject :: Stream s m Char => ParsecT s u m String

-- | Parse a comments header line but allow for the obsolete folding
--   syntax.
obs_comments :: Stream s m Char => ParsecT s u m String

-- | Parse a keywords header line but allow for the obsolete folding
--   syntax. Also, this parser accepts obs_phrase_list.
obs_keywords :: Stream s m Char => ParsecT s u m [String]

-- | Parse a resent_from header line but allow for the obsolete
--   folding syntax.
obs_resent_from :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a resent_sender header line but allow for the obsolete
--   folding syntax.
obs_resent_send :: Stream s m Char => ParsecT s u m NameAddr

-- | Parse a resent_date header line but allow for the obsolete
--   folding syntax.
obs_resent_date :: Stream s m Char => ParsecT s u m ZonedTime

-- | Parse a resent_to header line but allow for the obsolete
--   folding syntax.
obs_resent_to :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a resent_cc header line but allow for the obsolete
--   folding syntax.
obs_resent_cc :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a resent_bcc header line but allow for the obsolete
--   folding syntax.
obs_resent_bcc :: Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse a resent_msg_id header line but allow for the obsolete
--   folding syntax.
obs_resent_mid :: Stream s m Char => ParsecT s u m String

-- | Parse a Resent-Reply-To header line but allow for the
--   obsolete folding syntax.
obs_resent_reply :: Stream s m Char => ParsecT s u m [NameAddr]
obs_return :: Stream s m Char => ParsecT s u m String
obs_received :: Stream s m Char => ParsecT s u m [(String, String)]

-- | Match obs_angle_addr.
obs_path :: Stream s m Char => ParsecT s u m String

-- | This parser is identical to optional_field but allows the more
--   liberal line-folding syntax between the "field_name" and the "field
--   text".
obs_optional :: Stream s m Char => ParsecT s u m (String, String)
instance GHC.Show.Show a => GHC.Show.Show (Text.Parsec.Rfc2822.GenericMessage a)
instance GHC.Show.Show Text.Parsec.Rfc2822.Field
instance GHC.Classes.Eq Text.Parsec.Rfc2822.NameAddr
instance GHC.Show.Show Text.Parsec.Rfc2822.NameAddr
