| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Text.Reform.Lucid
Contents
Synopsis
- inputText :: (Monad m, FormError error, PathPiece text, Applicative f) => (input -> Either error text) -> text -> Form m input error (HtmlT f ()) () text
- inputPassword :: (Monad m, FormError error, PathPiece text, Applicative f) => (input -> Either error text) -> text -> Form m input error (HtmlT f ()) () text
- inputSubmit :: (Monad m, FormError error, PathPiece text, Applicative f) => (input -> Either error text) -> text -> Form m input error (HtmlT f ()) () (Maybe text)
- inputReset :: (Monad m, FormError error, PathPiece text, Applicative f) => text -> Form m input error (HtmlT f ()) () ()
- inputHidden :: (Monad m, FormError error, PathPiece text, Applicative f) => (input -> Either error text) -> text -> Form m input error (HtmlT f ()) () text
- inputButton :: (Monad m, FormError error, PathPiece text, Applicative f) => text -> Form m input error (HtmlT f ()) () ()
- textarea :: (Monad m, FormError error, ToHtml text, Monad f) => (input -> Either error text) -> Int -> Int -> text -> Form m input error (HtmlT f ()) () text
- inputFile :: (Monad m, FormError error, FormInput input, ErrorInputType error ~ input, Applicative f) => Form m input error (HtmlT f ()) () (FileType input)
- buttonSubmit :: (Monad m, FormError error, PathPiece text, ToHtml children, Monad f) => (input -> Either error text) -> text -> children -> Form m input error (HtmlT f ()) () (Maybe text)
- buttonReset :: (Monad m, FormError error, ToHtml children, Monad f) => children -> Form m input error (HtmlT f ()) () ()
- button :: (Monad m, FormError error, ToHtml children, Monad f) => children -> Form m input error (HtmlT f ()) () ()
- label :: (Monad m, Monad f) => HtmlT f () -> Form m input error (HtmlT f ()) () ()
- arbitraryHtml :: Monad m => view -> Form m input error view () ()
- inputInt :: (Monad m, FormError err, Applicative f) => (input -> Either err Int) -> Int -> Form m input err (HtmlT f ()) () Int
- inputDouble :: (Monad m, FormError err, Applicative f) => (input -> Either err Double) -> Double -> Form m input err (HtmlT f ()) () Double
- inputCheckbox :: forall x error input m f. (Monad m, FormInput input, FormError error, ErrorInputType error ~ input, Applicative f) => Bool -> Form m input error (HtmlT f ()) () Bool
- inputCheckboxes :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToHtml lbl, Monad f) => [(a, lbl)] -> (a -> Bool) -> Form m input error (HtmlT f ()) () [a]
- inputRadio :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToHtml lbl, Monad f) => [(a, lbl)] -> (a -> Bool) -> Form m input error (HtmlT f ()) () a
- select :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToHtml lbl, Monad f) => [(a, lbl)] -> (a -> Bool) -> Form m input error (HtmlT f ()) () a
- selectMultiple :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToHtml lbl, Monad f) => [(a, lbl)] -> (a -> Bool) -> Form m input error (HtmlT f ()) () [a]
- errorList :: (Monad m, ToHtml error, Monad f) => Form m input error (HtmlT f ()) () ()
- childErrorList :: (Monad m, ToHtml error, Monad f) => Form m input error (HtmlT f ()) () ()
- br :: (Monad m, Applicative f) => Form m input error (HtmlT f ()) () ()
- fieldset :: (Monad m, Functor m, Applicative f) => Form m input error (HtmlT f ()) proof a -> Form m input error (HtmlT f ()) proof a
- ol :: (Monad m, Functor m, Applicative f) => Form m input error (HtmlT f ()) proof a -> Form m input error (HtmlT f ()) proof a
- ul :: (Monad m, Functor m, Applicative f) => Form m input error (HtmlT f ()) proof a -> Form m input error (HtmlT f ()) proof a
- li :: (Monad m, Functor m, Applicative f) => Form m input error (HtmlT f ()) proof a -> Form m input error (HtmlT f ()) proof a
- formGenGET :: Applicative m => Text -> [(Text, Text)] -> HtmlT m b -> HtmlT m b
- formGenPOST :: Applicative m => Text -> [(Text, Text)] -> HtmlT m b -> HtmlT m b
- setAttr :: (Monad m, Functor m, Applicative f) => Form m input error (HtmlT f ()) proof a -> [Attribute] -> Form m input error (HtmlT f ()) proof a
Documentation
inputText :: (Monad m, FormError error, PathPiece text, Applicative f) => (input -> Either error text) -> text -> Form m input error (HtmlT f ()) () text Source #
inputPassword :: (Monad m, FormError error, PathPiece text, Applicative f) => (input -> Either error text) -> text -> Form m input error (HtmlT f ()) () text Source #
inputSubmit :: (Monad m, FormError error, PathPiece text, Applicative f) => (input -> Either error text) -> text -> Form m input error (HtmlT f ()) () (Maybe text) Source #
inputReset :: (Monad m, FormError error, PathPiece text, Applicative f) => text -> Form m input error (HtmlT f ()) () () Source #
inputHidden :: (Monad m, FormError error, PathPiece text, Applicative f) => (input -> Either error text) -> text -> Form m input error (HtmlT f ()) () text Source #
inputButton :: (Monad m, FormError error, PathPiece text, Applicative f) => text -> Form m input error (HtmlT f ()) () () Source #
inputFile :: (Monad m, FormError error, FormInput input, ErrorInputType error ~ input, Applicative f) => Form m input error (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 error, PathPiece text, ToHtml children, Monad f) => (input -> Either error text) -> text -> children -> Form m input error (HtmlT f ()) () (Maybe text) Source #
Create a <button type="submit"> element
buttonReset :: (Monad m, FormError error, ToHtml children, Monad f) => children -> Form m input error (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 error, ToHtml children, Monad f) => children -> Form m input error (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 () -> Form m input error (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 error view () () Source #
inputInt :: (Monad m, FormError err, Applicative f) => (input -> Either err Int) -> Int -> Form m input err (HtmlT f ()) () Int Source #
inputDouble :: (Monad m, FormError err, Applicative f) => (input -> Either err Double) -> Double -> Form m input err (HtmlT f ()) () Double Source #
Arguments
| :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input, Applicative f) | |
| => Bool | initially checked |
| -> Form m input error (HtmlT f ()) () Bool |
Create a single <input type="checkbox"> element
returns a Bool indicating if it was checked or not.
see also inputCheckboxes
FIXME: Should this built on something in Generalized?
Arguments
| :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToHtml lbl, Monad f) | |
| => [(a, lbl)] | value, label, initially checked |
| -> (a -> Bool) | function which indicates if a value should be checked initially |
| -> Form m input error (HtmlT f ()) () [a] |
Create a group of <input type="checkbox"> elements
Arguments
| :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToHtml lbl, Monad f) | |
| => [(a, lbl)] | value, label, initially checked |
| -> (a -> Bool) | isDefault |
| -> Form m input error (HtmlT f ()) () a |
Create a group of <input type="radio"> elements
Arguments
| :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToHtml lbl, Monad f) | |
| => [(a, lbl)] | value, label |
| -> (a -> Bool) | isDefault, must match *exactly one* element in the list of choices |
| -> Form m input error (HtmlT f ()) () a |
create <select></select> element plus its <option></option> children.
see also: selectMultiple
Arguments
| :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToHtml lbl, Monad f) | |
| => [(a, lbl)] | value, label, initially checked |
| -> (a -> Bool) | isSelected initially |
| -> Form m input error (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.
childErrorList :: (Monad m, ToHtml error, Monad f) => Form m input error (HtmlT f ()) () () Source #
fieldset :: (Monad m, Functor m, Applicative f) => Form m input error (HtmlT f ()) proof a -> Form m input error (HtmlT f ()) proof a Source #
wrap a <fieldset class="reform"> around a Form
ol :: (Monad m, Functor m, Applicative f) => Form m input error (HtmlT f ()) proof a -> Form m input error (HtmlT f ()) proof a Source #
wrap an <ol class="reform"> around a Form
ul :: (Monad m, Functor m, Applicative f) => Form m input error (HtmlT f ()) proof a -> Form m input error (HtmlT f ()) proof a Source #
wrap a <ul class="reform"> around a Form
li :: (Monad m, Functor m, Applicative f) => Form m input error (HtmlT f ()) proof a -> Form m input error (HtmlT f ()) proof a Source #
wrap a <li class="reform"> around a Form
Arguments
| :: Applicative m | |
| => Text | action url |
| -> [(Text, Text)] | hidden fields to add to form |
| -> HtmlT m b | |
| -> HtmlT m b |
create <form action=action method="GET" enctype="multipart/form-data">
Arguments
| :: Applicative m | |
| => Text | action url |
| -> [(Text, Text)] | hidden fields to add to form |
| -> HtmlT m b | |
| -> HtmlT m b |
create <form action=action method="POST" enctype="multipart/form-data">
setAttr :: (Monad m, Functor m, Applicative f) => Form m input error (HtmlT f ()) proof a -> [Attribute] -> Form m input error (HtmlT f ()) proof a Source #
add an attribute to the Html for a form element.