panthershark/email-parser/1.0.2

Email

Email parser and validation library.

type alias EmailAddress =
{ local : String
, domain : String
}

A model for representing an email. This is exposed, but you'll probably only use it is using parseEmailAddress

isValid : String -> Bool

Given a string, this returns true if the email is compatible with the spec.

    isValid "[email protected]" == True
    isValid "^^^^" == False
parse : String -> Result (List DeadEnd) EmailAddress

Given a string, parses into an EmailAddress model.

    parse "[email protected]" == Ok { local = "hello", domain = "world.com" }
    parse "^^^^" == Err [ dead ends ]
toString : EmailAddress -> String

Converts the EmailAddress model to a string.