-- 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.2


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

-- | Case-insensitive variant of Parsec's <a>char</a> function.
caseChar :: forall s (m :: Type -> Type) u. Stream s m Char => Char -> ParsecT s u m Char

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

-- | Match a parser at least <tt>n</tt> times.
manyN :: forall s u (m :: Type -> Type) a. Int -> ParsecT s u m a -> ParsecT s u m [a]

-- | Match a parser at least <tt>n</tt> times, but no more than <tt>m</tt>
--   times.
manyNtoM :: forall s u (m :: Type -> Type) a. Int -> Int -> ParsecT s u m a -> ParsecT s u m [a]

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

-- | Match either "1" or "0".
bit :: forall s (m :: Type -> Type) u. 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 :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char

-- | Match the carriage return character <tt>\r</tt>.
cr :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char

-- | Match returns the linefeed character <tt>\n</tt>.
lf :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char

-- | Match the Internet newline <tt>\r\n</tt>.
crlf :: forall s (m :: Type -> Type) u. 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 :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char

-- | Match the double quote character "<tt>"</tt>".
dquote :: forall s (m :: Type -> Type) u. 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 :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char

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

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

-- | Match <i>any</i> character.
octet :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char

-- | Match the space.
sp :: forall s (m :: Type -> Type) u. 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 :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char

-- | Match either <a>sp</a> or <a>htab</a>.
wsp :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char

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

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


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

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

-- | <tt>unfold</tt> <tt>=</tt> <tt>between (optional cfws) (optional
--   cfws)</tt>
unfold :: forall s (m :: Type -> Type) u a. 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 :: forall s (m :: Type -> Type) u a. Stream s m Char => String -> ParsecT s u m a -> ParsecT s u m a

-- | Like <a>header</a>, but allows the obsolete white-space rules.
obs_header :: forall s (m :: Type -> Type) u a. 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 :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char

-- | Match any US-ASCII character except for <tt>r</tt>, <tt>n</tt>.
text :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char

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

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

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

-- | Match any non-whitespace, non-control character except for
--   "<tt>(</tt>", "<tt>)</tt>", and "<tt>\</tt>". This is used to describe
--   the legal content of <a>comment</a>s.
--   
--   <i>Note</i>: 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 :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char

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

-- | Match any combination of <a>fws</a> and <a>comments</a>.
cfws :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m String

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

-- | Match one or more <a>atext</a> characters and skip any preceding or
--   trailing <a>cfws</a>.
atom :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m String

-- | Match <a>dot_atom_text</a> and skip any preceding or trailing
--   <a>cfws</a>.
dot_atom :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m String

-- | Match two or more <a>atext</a>s interspersed by dots.
dot_atom_text :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m String

-- | Match any non-whitespace, non-control US-ASCII character except for
--   "<tt>\</tt>" and "<tt>"</tt>".
qtext :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char

-- | Match either <a>qtext</a> or <a>quoted_pair</a>.
qcontent :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m String

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

-- | Match either <a>atom</a> or <a>quoted_string</a>.
word :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m String

-- | Match either one or more <a>word</a>s or an <a>obs_phrase</a>.
phrase :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m [String]

-- | Match any non-whitespace, non-control US-ASCII character except for
--   "<tt>\</tt>" and "<tt>"</tt>".
utext :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char

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

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

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

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

-- | This parser will match a date of the form "<tt>dd:mm:yyyy</tt>" and
--   return a tripple of the form (Int,Month,Int) - corresponding to
--   (year,month,day).
date :: forall s (m :: Type -> Type) u. 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 :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Int

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

-- | This parser will the abbreviated month names ("<tt>Jan</tt>",
--   "<tt>Feb</tt>", ...) and return the appropriate <a>Int</a> value in
--   the range of (1,12).
month_name :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Int
day_of_month :: forall s (m :: Type -> Type) u. 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 :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Int

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

-- | This parser will match a time-of-day specification of "<tt>hh:mm</tt>"
--   or "<tt>hh:mm:ss</tt>" and return the corrsponding time as a
--   <a>TimeOfDay</a>.
--   
--   <pre>
--   &gt;&gt;&gt; parseTest (time_of_day &lt;* eof) "12:03:23"
--   12:03:23
--   
--   &gt;&gt;&gt; parseTest (time_of_day &lt;* eof) "99:99:99"
--   parse error at (line 1, column 3):unknown parse error
--   </pre>
time_of_day :: forall s (m :: Type -> Type) u. 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.
--   
--   <pre>
--   &gt;&gt;&gt; parseTest hour "034"
--   3
--   
--   &gt;&gt;&gt; parseTest hour "99"
--   parse error at (line 1, column 3):unknown parse error
--   </pre>
hour :: forall s (m :: Type -> Type) u. 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.
--   
--   <pre>
--   &gt;&gt;&gt; parseTest minute "34"
--   34
--   
--   &gt;&gt;&gt; parseTest minute "61"
--   parse error at (line 1, column 3):unknown parse error
--   
--   &gt;&gt;&gt; parseTest (minute &lt;* eof) "034"
--   parse error at (line 1, column 3):
--   unexpected '4'
--   expecting end of input
--   </pre>
minute :: forall s (m :: Type -> Type) u. 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.
--   
--   <pre>
--   &gt;&gt;&gt; parseTest second "34"
--   34
--   </pre>
second :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Int

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

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

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

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

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

-- | Parse an <a>angle_addr</a> or an <a>obs_angle_addr</a> and return the
--   address.
angle_addr :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m String

-- | Parse a "group" of addresses. That is a <a>display_name</a>, followed
--   by a colon, optionally followed by a <a>mailbox_list</a>, followed by
--   a semicolon. The found address(es) are returned - what may be none.
--   Here is an example:
--   
--   <pre>
--   &gt;&gt;&gt; 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"}]
--   </pre>
group :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m [NameAddr]

-- | Parse and return a <a>phrase</a>.
display_name :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m String

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

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

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

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

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

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

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

-- | Parse and return any ASCII characters except "<tt>[</tt>",
--   "<tt>]</tt>", and "<tt>\</tt>".
dtext :: forall s (m :: Type -> Type) u. 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 <a>Field</a> 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 <a>OptionalField</a>s (which are
--   unparsed) in the resulting <a>Message</a>. 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 <a>fields</a> parser for further
--   details.
message :: forall s (m :: Type -> Type) u. (Monoid s, Stream s m Char) => ParsecT s u m (GenericMessage s)

-- | A message body is just an unstructured sequence of characters.
body :: forall s (m :: Type -> Type) u. (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 <a>Field</a> value is
--   created, all of them making up the <a>Field</a> list that this parser
--   returns.
--   
--   If you look at the implementation of this parser, you will find that
--   it uses Parsec's <a>try</a> modifier around <i>all</i> of the fields.
--   The idea behind this is that fields, which contain syntax errors, fall
--   back to the catch-all <a>optional_field</a>. Thus, this parser will
--   hardly ever return a syntax error -- what conforms with the idea that
--   any message that can possibly be accepted <i>should</i> be.
fields :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m [Field]

-- | Parse a "<tt>Date:</tt>" header line and return the date it contains a
--   <tt>CalendarTime</tt>.
orig_date :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m ZonedTime

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

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

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

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

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

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

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

-- | Parse a "<tt>In-Reply-To:</tt>" header line and return the list of
--   <a>msg_id</a>s contained in it.
in_reply_to :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m [String]

-- | Parse a "<tt>References:</tt>" header line and return the list of
--   <a>msg_id</a>s contained in it.
references :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m [String]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

-- | Match and return any ASCII character except for control characters,
--   whitespace, and "<tt>:</tt>".
ftext :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char

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

-- | Match the obsolete "text" syntax, which - unlike <a>text</a> - 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 :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m String

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

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

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

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

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

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

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

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

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

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

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

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

-- | Match the obsolete zone names and return the appropriate offset.
obs_zone :: forall s (m :: Type -> Type) u. 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 <a>angle_addr</a> 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):
--   
--   <pre>
--   &gt;&gt;&gt; parse obs_angle_addr "" "&lt;@example1.org,@example2.org:joe@example.org&gt;"
--   Right "&lt;joe@example.org&gt;"
--   </pre>
obs_angle_addr :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m String

-- | This parser parses the "route" part of <a>obs_angle_addr</a> and
--   returns the list of <a>String</a>s that make up this route. Relies on
--   <a>obs_domain_list</a> for the actual parsing.
obs_route :: forall s (m :: Type -> Type) u. 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
--   <a>domain</a>s is returned - and may be empty.
obs_domain_list :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m [String]

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

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

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

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

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

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

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

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

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

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

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

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

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

-- | Parse a <a>references</a> header line but allow for the obsolete
--   folding and the obsolete phrase syntax.
obs_references :: forall s (m :: Type -> Type) u. 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 <a>local_part</a>.
obs_id_left :: forall s (m :: Type -> Type) u. 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 <a>domain</a>.
obs_id_right :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m String

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

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

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

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

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

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

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

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

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

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

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

-- | Match <a>obs_angle_addr</a>.
obs_path :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m String

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