https://github.com/pjones/addy
A full-featured library for parsing, validating, and rendering email addresses
https://github.com/pjones/addy
Last synced: 10 months ago
JSON representation
A full-featured library for parsing, validating, and rendering email addresses
- Host: GitHub
- URL: https://github.com/pjones/addy
- Owner: pjones
- License: bsd-2-clause
- Created: 2020-04-30T00:46:24.000Z (over 5 years ago)
- Default Branch: trunk
- Last Pushed: 2020-10-29T19:53:33.000Z (about 5 years ago)
- Last Synced: 2024-04-29T14:01:48.288Z (over 1 year ago)
- Language: Haskell
- Homepage:
- Size: 292 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
Addy: a modern library for working with email addresses
=======================================================
[](https://github.com/pjones/addy/actions)
[](https://github.com/pjones/addy/releases)
[](https://hackage.haskell.org/package/addy)
[](https://github.com/pjones/addy/blob/master/LICENSE)
A full-featured library for parsing, validating, and rendering email
addresses.
Decoding
--------
```haskell
Addy.decode "example@example.com"
-- Right (EmailAddr "example@example.com")
Addy.decode "我買@屋企.香港"
-- Right (EmailAddr "\25105\36023@\23627\20225.\39321\28207")
Addy.decode "Mary Smith (hi there!)"
-- Right (EmailAddr "Mary Smith (hi there!)")
Addy.decode "example@[127.0.0.1]"
-- Right (EmailAddr "example@[127.0.0.1]")
```
Encoding
--------
```haskell
Addy.encode address
-- "example@example.com"
Addy.decode "Mary Smith (hi there!)"
& second Addy.encodeFull
-- Right "Mary Smith (hi there!)"
```