Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- data EmailAddress
- validate :: ByteString -> Either String EmailAddress
- toByteString :: EmailAddress -> ByteString
Email address
data EmailAddress #
Represents an email address.
Instances
validate :: ByteString -> Either String EmailAddress #
If you want to find out *why* a particular string is not an email address, use this.
Examples:
>>>
validate "example@example.com"
Right "example@example.com"
>>>
validate "not.good"
Left "at sign > @: not enough input"
toByteString :: EmailAddress -> ByteString #
Converts an email address back to a ByteString