Safe Haskell | None |
---|
- data Validation a
- = Check ([Text] -> Maybe a)
- | Includes (GroupedCollection' a)
- class DefaultValidation a where
- vdef :: Validation a
- vdefList :: Validation [a]
- newtype ShowRead a = ShowRead a
- unShowRead :: ShowRead a -> a
- newtype SelectEnum a = SelectEnum a
- unSelectEnum :: SelectEnum a -> a
- bool :: Validation Bool
- text :: Validation Text
- textLength :: Int -> Validation Text
- read :: Read a => Validation a
- email :: Validation EmailAddress
- uri :: Validation URI
- absoluteUri :: Validation URI
- dateFormat :: ParseTime a => String -> Validation a
- date :: ParseTime a => Validation a
- time :: ParseTime a => Validation a
- datetime :: ParseTime a => Validation a
- datetime_local :: ParseTime a => Validation a
- type GroupedCollection' a = [(Text, [(a, (Text, Text))])]
- type Collection' a = [(a, (Text, Text))]
- includes :: GroupedCollection' a -> Validation a
- multi_includes :: GroupedCollection' a -> Validation [a]
- pmap :: (a -> Maybe b) -> Validation a -> Validation b
- selectEnum :: (Show a, Read a, Bounded a, Enum a) => Collection' a
- selectEnumIdx :: (Show a, Bounded a, Enum a) => Collection' a
- enumIdx :: (Show a, Bounded a, Enum a) => (GroupedCollection' a -> Validation a) -> Validation a
- multiEnum :: (Show a, Read a, Bounded a, Enum a) => (GroupedCollection' a -> Validation [a]) -> Validation [a]
- multiEnumIdx :: (Show a, Bounded a, Enum a) => (GroupedCollection' a -> Validation [a]) -> Validation [a]
- group_ :: Collection' a -> GroupedCollection' a
- viewGroupedCollection :: GroupedCollection' a -> GroupedCollection
Documentation
data Validation a Source
Either try to parse the submitted values, or have a list of allowed values
Check ([Text] -> Maybe a) | |
Includes (GroupedCollection' a) |
class DefaultValidation a whereSource
vdef :: Validation aSource
vdefList :: Validation [a]Source
Wrappers
unShowRead :: ShowRead a -> aSource
newtype SelectEnum a Source
Wrapper for select boxes on enumerable types
Bounded a => Bounded (SelectEnum a) | |
Enum a => Enum (SelectEnum a) | |
Eq a => Eq (SelectEnum a) | |
Ord a => Ord (SelectEnum a) | |
Read a => Read (SelectEnum a) | |
(Show a, Read a) => Show (SelectEnum a) | |
(Show a, Read a, Bounded a, Enum a) => DefaultWidget (SelectEnum a) | |
(Show a, Read a, Bounded a, Enum a) => DefaultValidation (SelectEnum a) |
unSelectEnum :: SelectEnum a -> aSource
Validations
Text-like
text :: Validation TextSource
textLength :: Int -> Validation TextSource
read :: Read a => Validation aSource
uri :: Validation URISource
absoluteUri :: Validation URISource
Dates and times
dateFormat :: ParseTime a => String -> Validation aSource
date :: ParseTime a => Validation aSource
time :: ParseTime a => Validation aSource
datetime :: ParseTime a => Validation aSource
datetime_local :: ParseTime a => Validation aSource
Collections
type GroupedCollection' a = [(Text, [(a, (Text, Text))])]Source
GroupedCollection
including the parsed value
type Collection' a = [(a, (Text, Text))]Source
Collection
including the parsed value
includes :: GroupedCollection' a -> Validation aSource
multi_includes :: GroupedCollection' a -> Validation [a]Source
Helpers
pmap :: (a -> Maybe b) -> Validation a -> Validation bSource
Map over a Validation
with a partial function
selectEnum :: (Show a, Read a, Bounded a, Enum a) => Collection' aSource
Derive a collection from an enumerable type
selectEnumIdx :: (Show a, Bounded a, Enum a) => Collection' aSource
Derive an indexed collection from an enumerable type
enumIdx :: (Show a, Bounded a, Enum a) => (GroupedCollection' a -> Validation a) -> Validation aSource
Feed a collection Validation
from an enumerable type
multiEnum :: (Show a, Read a, Bounded a, Enum a) => (GroupedCollection' a -> Validation [a]) -> Validation [a]Source
Feed a multi-select collection Validation
from an enumerable type
multiEnumIdx :: (Show a, Bounded a, Enum a) => (GroupedCollection' a -> Validation [a]) -> Validation [a]Source
Feed a multi-select collection Validation
from an enumerable type
group_ :: Collection' a -> GroupedCollection' aSource
Push any Collection'
to a trivial GroupedCollection'
viewGroupedCollection :: GroupedCollection' a -> GroupedCollectionSource
Convert a GroupedCollection'
to a GroupedCollection
for use in a view