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


-- | Email address validation
--   
--   Validating an email address string against RFC 5322
@package email-validate
@version 2.3.1

module Text.Email.Parser

-- | A parser for email addresses.
addrSpec :: Parser EmailAddress

-- | Extracts the local part of an email address.
localPart :: EmailAddress -> ByteString

-- | Extracts the domain part of an email address.
domainPart :: EmailAddress -> ByteString

-- | Represents an email address.
data EmailAddress

-- | Creates an email address without validating it. You should only use
--   this when reading data from somewhere it has already been validated
--   (e.g. a database).
unsafeEmailAddress :: ByteString -> ByteString -> EmailAddress

-- | Converts an email address back to a ByteString
toByteString :: EmailAddress -> ByteString
instance GHC.Generics.Generic Text.Email.Parser.EmailAddress
instance Data.Data.Data Text.Email.Parser.EmailAddress
instance GHC.Classes.Ord Text.Email.Parser.EmailAddress
instance GHC.Classes.Eq Text.Email.Parser.EmailAddress
instance GHC.Show.Show Text.Email.Parser.EmailAddress
instance GHC.Read.Read Text.Email.Parser.EmailAddress

module Text.Email.Validate

-- | Validates whether a particular string is an email address according to
--   RFC5322.
isValid :: ByteString -> Bool

-- | If you want to find out *why* a particular string is not an email
--   address, use this.
--   
--   Examples:
--   
--   <pre>
--   &gt;&gt;&gt; validate "example@example.com"
--   Right "example@example.com"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; validate "not.good"
--   Left "at sign &gt; @: not enough input"
--   </pre>
validate :: ByteString -> Either String EmailAddress

-- | Smart constructor for an email address
emailAddress :: ByteString -> Maybe EmailAddress

-- | Checks that an email is valid and returns a version of it where
--   comments and whitespace have been removed.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; canonicalizeEmail "spaces. are. allowed@example.com"
--   Just "spaces.are.allowed@example.com"
--   </pre>
canonicalizeEmail :: ByteString -> Maybe ByteString

-- | Represents an email address.
data EmailAddress

-- | Extracts the domain part of an email address.
domainPart :: EmailAddress -> ByteString

-- | Extracts the local part of an email address.
localPart :: EmailAddress -> ByteString

-- | Converts an email address back to a ByteString
toByteString :: EmailAddress -> ByteString

-- | Creates an email address without validating it. You should only use
--   this when reading data from somewhere it has already been validated
--   (e.g. a database).
unsafeEmailAddress :: ByteString -> ByteString -> EmailAddress

module Text.Email.QuasiQuotation

-- | A QuasiQuoter for email addresses.
--   
--   Use it like this:
--   
--   <pre>
--   &gt;&gt;&gt; :set -XQuasiQuotes
--   
--   &gt;&gt;&gt; [email|someone@example.com|]
--   "someone@example.com"
--   </pre>
email :: QuasiQuoter
