Safe Haskell | None |
---|
WASH.CGI.Fields
- class Reason a where
- newtype EmailAddress = EmailAddress {
- unEmailAddress :: String
- newtype CreditCardNumber = CreditCardNumber {
- unCreditCardNumber :: String
- luhnCheck :: [Char] -> Bool
- data CreditCardExp = CreditCardExp {}
- newtype NonEmpty = NonEmpty {
- unNonEmpty :: String
- newtype Phone = Phone {
- unPhone :: String
- phoneChars :: [Char]
- newtype AllDigits = AllDigits {
- unAllDigits :: String
- newtype Text = Text {
- unText :: String
- parseURL :: Parser [Char] URL
- parseScheme :: Parser [Char] [Char]
- 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
Instances
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
Constructors
EmailAddress | |
Fields
|
Instances
Read EmailAddress | |
Show EmailAddress | |
Reason EmailAddress |
newtype CreditCardNumber Source
Reads a credit card number and performs Luhn check on it.
Constructors
CreditCardNumber | |
Fields
|
Instances
data CreditCardExp Source
Constructors
CreditCardExp | |
Instances
Read CreditCardExp | |
Show CreditCardExp | |
Reason CreditCardExp |
Non-empty strings.
Constructors
NonEmpty | |
Fields
|
Phone numbers.
phoneChars :: [Char]Source
Non-empty strings of digits.
Constructors
AllDigits | |
Fields
|
Arbitrary string data. No quotes required.
parseScheme :: Parser [Char] [Char]Source
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.
Constructors
Password | |
Fields
|
Data type for transforming a field into an optional one. The Read
syntax of
Absent
is the empty string, whereas the Read
syntax of Present a
is just the
Read
syntax of a
. Analogously for Show
.
fromPresent :: Optional a -> aSource
Analogous to Maybe.fromJust
fromOptional :: a -> Optional a -> aSource
Analogous to Maybe.fromMaybe