Safe Haskell | None |
---|
Validations.Tutorial
Contents
- eitherToResult :: Either a b -> Result a b
- data User = User {
- _firstName :: Text
- _lastName :: Text
- _emailAddress :: Text
- notEmpty :: (Monoid a, Eq a) => a -> Either Text a
- startsWith :: Text -> Text -> Either Text Text
- confirms :: Eq a => a -> a -> Either Text a
- user :: Text -> Text -> Text -> Text -> Either Text User
- userForm :: Monad m => Form Text m User
- nonEmpty :: (Monoid a, Eq a) => Checker Text a a
- data Account = Account {
- _name :: Text
- _accountNumber :: Text
- name :: Lens Text Account
- accountNumber :: Lens Text Account
- nameField :: Text
- confirmNameField :: Text
- accountNumberField :: Text
- accountForm :: Monad m => Form Text m (Text, Text, Text)
- lengthIs :: Int -> Checker Text Text Text
- accountValidation :: Monad m => (Text, Text, Text) -> Validation [(Text, Text)] m Account Account
- posted :: Monad m => m (View Text, Maybe (Text, Text, Text))
- validatedPosted :: Monad m => m (View Text, Maybe Account)
Documentation
eitherToResult :: Either a b -> Result a bSource
validations** is a Haskell library that provides a flexible,
Constructors
User | |
Fields
|
digestive-functors** solves the multiple validations problem. Our formlet could look like:
validations** is based around 4 different data types. First, a *Checker* is
Constructors
Account | |
Fields
|