- class Reason a where
- newtype EmailAddress = EmailAddress {}
- newtype CreditCardNumber = CreditCardNumber {}
- data CreditCardExp = CreditCardExp {}
- newtype NonEmpty = NonEmpty {
- unNonEmpty :: String
- newtype Phone = Phone {}
- newtype AllDigits = AllDigits {}
- newtype Text = Text {}
- newtype Password = Password {
- unPassword :: String
- data Optional a
- fromPresent :: Optional a -> a
- fromOptional :: a -> Optional a -> a
Documentation
method reason
of this class maps a value of type a to an explanation of
the input syntax for a value of type a
Reason Bool | |
Reason Char | |
Reason Double | |
Reason Float | |
Reason Int | |
Reason Integer | |
Reason () | |
Reason ISOTime | |
Reason ISODate | Date and time in ISO8601 format |
Reason ISODateAndTime | |
Reason FileReference | |
Reason URL | |
Reason Password | |
Reason Text | |
Reason AllDigits | |
Reason Phone | |
Reason NonEmpty | |
Reason CreditCardExp | |
Reason CreditCardNumber | |
Reason EmailAddress | |
Reason a => Reason [a] | |
Reason a => Reason (Optional a) | |
(Reason a, Reason b) => Reason (a, b) | |
(Reason a, Reason b, Reason c) => Reason (a, b, c) |
newtype EmailAddress Source
Reads an email address according to RFC 2822
newtype CreditCardNumber Source
Reads a credit card number and performs Luhn check on it.
Non-empty strings.
Non-empty strings of digits.
Arbitrary string data. No quotes required.
A Password is a string of length >= 8 with characters taken from at least three of the four sets: lower case characters, upper case characters, digits, and special characters.
fromPresent :: Optional a -> aSource
Analogous to Maybe.fromJust
fromOptional :: a -> Optional a -> aSource
Analogous to Maybe.fromMaybe