Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- input :: (Monad m, FormError err) => (input -> Either err a) -> (FormId -> a -> view) -> a -> Form m input err view () a
- inputMaybe :: (Monad m, FormError err) => (input -> Either err a) -> (FormId -> a -> view) -> a -> Form m input err view () (Maybe a)
- inputNoData :: Monad m => (FormId -> a -> view) -> a -> Form m input err view () ()
- inputFile :: forall m input err view. (Monad m, FormInput input, FormError err, ErrorInputType err ~ input) => (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) => [(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) => (a -> Bool) -> [(a, lbl)] -> (FormId -> [(FormId, Int, lbl, Bool)] -> view) -> Form m input err view () a
- inputChoiceForms :: forall a m err input lbl view proof. (Functor m, Monad m, FormError err, ErrorInputType err ~ input, FormInput input) => a -> [(Form m input err view proof a, lbl)] -> (FormId -> [(FormId, Int, FormId, view, lbl, Bool)] -> view) -> Form m input err view proof a
- label :: Monad m => (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 () ()
Documentation
input :: (Monad m, FormError err) => (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) => (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 => (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) => (FormId -> view) -> Form m input err view () (FileType input) Source #
used for <input type="file">
:: (Functor m, FormError err, ErrorInputType err ~ input, FormInput input, Monad m) | |
=> [(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
:: (Functor m, FormError err, ErrorInputType err ~ input, FormInput input, Monad m) | |
=> (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
:: (Functor m, Monad m, FormError err, ErrorInputType err ~ input, FormInput input) | |
=> a | |
-> [(Form m input err view proof a, lbl)] | value, label |
-> (FormId -> [(FormId, Int, FormId, view, lbl, Bool)] -> view) | function which generates the view |
-> Form m input err view proof a |
radio buttons, single <select>
boxes
label :: Monad m => (FormId -> view) -> Form m input err view () () Source #
used to create <label>
elements