Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- foldTraverse_ :: (Foldable t, Applicative f, Monoid (f b)) => (a -> t (f b)) -> t a -> f ()
- inputText :: (Monad m, FormError err input, PathPiece text, Applicative f) => (input -> Either err text) -> String -> text -> Form m input err (HtmlT f ()) text
- inputTextMReq :: (Monad m, FormError err input, PathPiece text, Applicative f) => (input -> Either err text) -> String -> Maybe text -> Form m input err (HtmlT f ()) text
- inputPassword :: (Monad m, FormError err input, PathPiece text, Applicative f) => (input -> Either err text) -> String -> text -> Form m input err (HtmlT f ()) text
- inputSubmit :: (Monad m, FormError err input, PathPiece text, Applicative f) => (input -> Either err text) -> String -> text -> Form m input err (HtmlT f ()) (Maybe text)
- inputReset :: (Monad m, FormError err input, PathPiece text, Applicative f) => String -> text -> Form m input err (HtmlT f ()) ()
- inputHidden :: (Monad m, FormError err input, PathPiece text, Applicative f) => (input -> Either err text) -> String -> text -> Form m input err (HtmlT f ()) text
- inputButton :: (Monad m, FormError err input, PathPiece text, Applicative f) => String -> text -> Form m input err (HtmlT f ()) ()
- textarea :: (Monad m, FormError err input, ToHtml text, Monad f) => (input -> Either err text) -> Int -> Int -> String -> text -> Form m input err (HtmlT f ()) text
- inputFile :: (Monad m, FormError err input, FormInput input, Applicative f) => String -> Form m input err (HtmlT f ()) (FileType input)
- buttonSubmit :: (Monad m, FormError err input, PathPiece text, ToHtml children, Monad f) => (input -> Either err text) -> String -> text -> children -> Form m input err (HtmlT f ()) (Maybe text)
- buttonReset :: (Monad m, FormError err input, Monad f) => String -> HtmlT f () -> Form m input err (HtmlT f ()) ()
- button :: (Monad m, FormError err input, Monad f) => String -> HtmlT f () -> Form m input err (HtmlT f ()) ()
- label :: (Monad m, Monad f) => HtmlT f () -> String -> Form m input err (HtmlT f ()) ()
- arbitraryHtml :: Monad m => view -> Form m input err view ()
- inputInt :: (Monad m, FormError err input, Applicative f) => (input -> Either err Int) -> String -> Int -> Form m input err (HtmlT f ()) Int
- inputDouble :: (Monad m, FormError err input, Applicative f) => (input -> Either err Double) -> String -> Double -> Form m input err (HtmlT f ()) Double
- inputCheckbox :: forall err input m f. (Monad m, FormError err input, Applicative f) => Bool -> String -> Form m input err (HtmlT f ()) Bool
- inputCheckboxes :: (Functor m, Monad m, FormError err input, FormInput input, ToHtml lbl, Monad f) => String -> [(a, lbl)] -> (a -> Bool) -> Form m input err (HtmlT f ()) [a]
- inputRadio :: (Functor m, Monad m, FormError err input, FormInput input, Monad f) => String -> [(a, Html ())] -> (a -> Bool) -> Form m input err (HtmlT f ()) a
- select :: (Functor m, Monad m, FormError err input, FormInput input, Monad f) => String -> [(a, Html ())] -> (a -> Bool) -> Form m input err (HtmlT f ()) a
- selectMultiple :: (Functor m, Monad m, FormError err input, FormInput input, Monad f) => String -> [(a, Html ())] -> (a -> Bool) -> Form m input err (HtmlT f ()) [a]
Documentation
foldTraverse_ :: (Foldable t, Applicative f, Monoid (f b)) => (a -> t (f b)) -> t a -> f () Source #
inputText :: (Monad m, FormError err input, PathPiece text, Applicative f) => (input -> Either err text) -> String -> text -> Form m input err (HtmlT f ()) text Source #
inputTextMReq :: (Monad m, FormError err input, PathPiece text, Applicative f) => (input -> Either err text) -> String -> Maybe text -> Form m input err (HtmlT f ()) text Source #
inputPassword :: (Monad m, FormError err input, PathPiece text, Applicative f) => (input -> Either err text) -> String -> text -> Form m input err (HtmlT f ()) text Source #
inputSubmit :: (Monad m, FormError err input, PathPiece text, Applicative f) => (input -> Either err text) -> String -> text -> Form m input err (HtmlT f ()) (Maybe text) Source #
inputReset :: (Monad m, FormError err input, PathPiece text, Applicative f) => String -> text -> Form m input err (HtmlT f ()) () Source #
inputHidden :: (Monad m, FormError err input, PathPiece text, Applicative f) => (input -> Either err text) -> String -> text -> Form m input err (HtmlT f ()) text Source #
inputButton :: (Monad m, FormError err input, PathPiece text, Applicative f) => String -> text -> Form m input err (HtmlT f ()) () Source #
inputFile :: (Monad m, FormError err input, FormInput input, Applicative f) => String -> Form m input err (HtmlT f ()) (FileType input) Source #
Create an <input type="file">
element
This control may succeed even if the user does not actually select a file to upload. In that case the uploaded name will likely be "" and the file contents will be empty as well.
buttonSubmit :: (Monad m, FormError err input, PathPiece text, ToHtml children, Monad f) => (input -> Either err text) -> String -> text -> children -> Form m input err (HtmlT f ()) (Maybe text) Source #
Create a <button type="submit">
element
buttonReset :: (Monad m, FormError err input, Monad f) => String -> HtmlT f () -> Form m input err (HtmlT f ()) () Source #
create a <button type="reset"></button>
element
This element does not add any data to the form data set.
button :: (Monad m, FormError err input, Monad f) => String -> HtmlT f () -> Form m input err (HtmlT f ()) () Source #
create a <button type="button"></button>
element
This element does not add any data to the form data set.
label :: (Monad m, Monad f) => HtmlT f () -> String -> Form m input err (HtmlT f ()) () Source #
create a <label>
element.
Use this with or ++ to ensure that the for
attribute references the correct id
.
label "some input field: " ++> inputText ""
arbitraryHtml :: Monad m => view -> Form m input err view () Source #
inputInt :: (Monad m, FormError err input, Applicative f) => (input -> Either err Int) -> String -> Int -> Form m input err (HtmlT f ()) Int Source #
inputDouble :: (Monad m, FormError err input, Applicative f) => (input -> Either err Double) -> String -> Double -> Form m input err (HtmlT f ()) Double Source #
:: (Monad m, FormError err input, Applicative f) | |
=> Bool | initially checked |
-> String | |
-> Form m input err (HtmlT f ()) Bool |
Create a single <input type="checkbox">
element
returns a Bool
indicating if it was checked or not.
see also inputCheckboxes
:: (Functor m, Monad m, FormError err input, FormInput input, ToHtml lbl, Monad f) | |
=> String | |
-> [(a, lbl)] | value, label, initially checked |
-> (a -> Bool) | function which indicates if a value should be checked initially |
-> Form m input err (HtmlT f ()) [a] |
Create a group of <input type="checkbox">
elements
:: (Functor m, Monad m, FormError err input, FormInput input, Monad f) | |
=> String | |
-> [(a, Html ())] | value, label, initially checked |
-> (a -> Bool) | isDefault |
-> Form m input err (HtmlT f ()) a |
Create a group of <input type="radio">
elements
:: (Functor m, Monad m, FormError err input, FormInput input, Monad f) | |
=> String | |
-> [(a, Html ())] | value, label |
-> (a -> Bool) | isDefault, must match *exactly one* element in the list of choices |
-> Form m input err (HtmlT f ()) a |
create <select></select>
element plus its <option></option>
children.
see also: selectMultiple
:: (Functor m, Monad m, FormError err input, FormInput input, Monad f) | |
=> String | |
-> [(a, Html ())] | value, label, initially checked |
-> (a -> Bool) | isSelected initially |
-> Form m input err (HtmlT f ()) [a] |
create <select multiple="multiple"></select>
element plus its <option></option>
children.
This creates a <select>
element which allows more than one item to be selected.