-- 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 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: >>> validate "exampleexample.com" Right -- "exampleexample.com" >>> validate "not.good" Left "at -- sign > @: not enough input" 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: >>> canonicalizeEmail "spaces. are. -- allowedexample.com" Just "spaces.are.allowedexample.com" 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: -- --
--   >>> :set -XQuasiQuotes
--   
--   >>> [email|someone@example.com|]
--   "someone@example.com"
--   
email :: QuasiQuoter