html-email-validate-0.2.0.0: Validating an email address against HTML standard

Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.Html.Email.Validate

Contents

Synopsis

Validating

isValidEmail :: Text -> Bool Source

Validates given email. Email shouldn't have trailing or preceding spaces

>>> :set -XOverloadedStrings
>>> isValidEmail "name@example.com"
True
>>> isValidEmail "name@example..com"
False

Parsing

emailToText :: EmailAddress -> Text Source

Convert to text.

>>> emailToText $ EmailAddress "name" "example.com"
"name@example.com

parseEmail :: Text -> Either String EmailAddress Source

Parce an email. Error messages aren't very helpful.

emailParser :: Parser EmailAddress Source

Attoparsec parser.