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


-- | Validating an email address string against RFC 5322
--   
--   Validating an email address string against RFC 5322
@package email-validate
@version 2.2.0

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.
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.
canonicalizeEmail :: ByteString -> Maybe 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

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

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

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