| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Ditto.Generalized.Named
Synopsis
- input :: (Monad m, FormError err input) => String -> (input -> Either err a) -> (FormId -> a -> view) -> a -> Form m input err view a
- inputMaybeReq :: (Monad m, FormError err input) => String -> (input -> Either err a) -> (FormId -> Maybe a -> view) -> Maybe a -> Form m input err view a
- inputMaybe :: (Monad m, FormError err input) => String -> (input -> Either err a) -> (FormId -> Maybe a -> view) -> Maybe a -> Form m input err view (Maybe a)
- inputNoData :: Monad m => String -> (FormId -> view) -> Form m input err view ()
- inputFile :: forall m input err view. (Monad m, FormInput input, FormError err input) => String -> (FormId -> view) -> Form m input err view (FileType input)
- inputMulti :: forall m input err view a lbl. (FormError err input, FormInput input, Monad m) => String -> [(a, lbl)] -> (FormId -> [(FormId, Int, lbl, Bool)] -> view) -> (a -> Bool) -> Form m input err view [a]
- inputChoice :: forall a m err input lbl view. (FormError err input, FormInput input, Monad m) => String -> (a -> Bool) -> [(a, lbl)] -> (FormId -> [(FormId, Int, lbl, Bool)] -> view) -> Form m input err view a
- inputChoiceForms :: forall a m err input lbl view. (Monad m, FormError err input, FormInput input) => String -> a -> [(Form m input err view a, lbl)] -> (FormId -> [(FormId, Int, FormId, view, lbl, Bool)] -> view) -> Form m input err view a
- label :: Monad m => String -> (FormId -> view) -> Form m input err view ()
- errors :: Monad m => ([err] -> view) -> Form m input err view ()
- childErrors :: Monad m => ([err] -> view) -> Form m input err view ()
- withErrors :: Monad m => (view -> [err] -> view) -> Form m input err view a -> Form m input err view a
Documentation
input :: (Monad m, FormError err input) => String -> (input -> Either err a) -> (FormId -> a -> view) -> a -> Form m input err view a Source #
used for constructing elements like <input type="text">, which pure a single input value.
inputMaybeReq :: (Monad m, FormError err input) => String -> (input -> Either err a) -> (FormId -> Maybe a -> view) -> Maybe a -> Form m input err view a Source #
used to construct elements with optional initial values, which are still required
inputMaybe :: (Monad m, FormError err input) => String -> (input -> Either err a) -> (FormId -> Maybe a -> view) -> Maybe a -> Form m input err view (Maybe a) Source #
used for elements like <input type="submit"> which are not always present in the form submission data.
inputNoData :: Monad m => String -> (FormId -> view) -> Form m input err view () Source #
used for elements like <input type="reset"> which take a value, but are never present in the form data set.
inputFile :: forall m input err view. (Monad m, FormInput input, FormError err input) => String -> (FormId -> view) -> Form m input err view (FileType input) Source #
used for <input type="file">
Arguments
| :: (FormError err input, FormInput input, Monad m) | |
| => String | |
| -> [(a, lbl)] | value, label, initially checked |
| -> (FormId -> [(FormId, Int, lbl, Bool)] -> view) | function which generates the view |
| -> (a -> Bool) | isChecked/isSelected initially |
| -> Form m input err view [a] |
used for groups of checkboxes, <select multiple="multiple"> boxes
Arguments
| :: (FormError err input, FormInput input, Monad m) | |
| => String | |
| -> (a -> Bool) | is default |
| -> [(a, lbl)] | value, label |
| -> (FormId -> [(FormId, Int, lbl, Bool)] -> view) | function which generates the view |
| -> Form m input err view a |
radio buttons, single <select> boxes
Arguments
| :: (Monad m, FormError err input, FormInput input) | |
| => String | |
| -> a | |
| -> [(Form m input err view a, lbl)] | value, label |
| -> (FormId -> [(FormId, Int, FormId, view, lbl, Bool)] -> view) | function which generates the view |
| -> Form m input err view a |
radio buttons, single <select> boxes
label :: Monad m => String -> (FormId -> view) -> Form m input err view () Source #
used to create <label> elements