Safe Haskell | None |
---|---|
Language | Haskell98 |
Ditto.Generalized.Named
Synopsis
- input :: (Monad m, FormError err) => String -> (input -> Either err a) -> (FormId -> a -> view) -> a -> Form m input err view a
- inputMaybe :: (Monad m, FormError err) => String -> (input -> Either err a) -> (FormId -> a -> view) -> a -> Form m input err view (Maybe a)
- inputNoData :: Monad m => String -> (FormId -> a -> view) -> a -> Form m input err view ()
- inputFile :: forall m input err view. (Monad m, FormInput input, FormError err, ErrorInputType err ~ input) => String -> (FormId -> view) -> Form m input err view (FileType input)
- inputMulti :: forall m input err view a lbl. (Functor m, FormError err, ErrorInputType 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. (Functor m, FormError err, ErrorInputType 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. (Functor m, Monad m, FormError err, ErrorInputType 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) => 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.
inputMaybe :: (Monad m, FormError err) => String -> (input -> Either err a) -> (FormId -> a -> view) -> 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 -> a -> view) -> a -> 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, ErrorInputType err ~ input) => String -> (FormId -> view) -> Form m input err view (FileType input) Source #
used for <input type="file">
Arguments
:: (Functor m, FormError err, ErrorInputType 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
:: (Functor m, FormError err, ErrorInputType 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
:: (Functor m, Monad m, FormError err, ErrorInputType 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