reform-hsp-0.2.7.1: Add support for using HSP with Reform

Safe Haskell | None
Language | Haskell98

Text.Reform.HSP.Common

Contents

- Orphan instances

Synopsis

- inputText :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => (input -> Either error text) -> text -> Form m input error [XMLGenT x (XMLType x)] () text
- inputEmail :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => (input -> Either error text) -> text -> Form m input error [XMLGenT x (XMLType x)] () text
- inputPassword :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => (input -> Either error text) -> text -> Form m input error [XMLGenT x (XMLType x)] () text
- inputSubmit :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => (input -> Either error text) -> text -> Form m input error [XMLGenT x (XMLType x)] () (Maybe text)
- inputReset :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => text -> Form m input error [XMLGenT x (XMLType x)] () ()
- inputHidden :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => (input -> Either error text) -> text -> Form m input error [XMLGenT x (XMLType x)] () text
- inputButton :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => text -> Form m input error [XMLGenT x (XMLType x)] () ()
- textarea :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsChild x text) => (input -> Either error text) -> Int -> Int -> text -> Form m input error [XMLGenT x (XMLType x)] () text
- inputFile :: (Monad m, FormError error, FormInput input, ErrorInputType error ~ input, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId)) => Form m input error [XMLGenT x (XMLType x)] () (FileType input)
- buttonSubmit :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsChild x children, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => (input -> Either error text) -> text -> children -> Form m input error [XMLGenT x (XMLType x)] () (Maybe text)
- buttonReset :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsChild x children, EmbedAsAttr x (Attr Text FormId)) => children -> Form m input error [XMLGenT x (XMLType x)] () ()
- button :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsChild x children, EmbedAsAttr x (Attr Text FormId)) => children -> Form m input error [XMLGenT x (XMLType x)] () ()
- label :: (Monad m, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsChild x c) => c -> Form m input error [XMLGenT x (XMLType x)] () ()
- inputCheckbox :: forall x error input m. (Monad m, FormInput input, FormError error, ErrorInputType error ~ input, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId)) => Bool -> Form m input error [XMLGenT x (XMLType x)] () Bool
- inputCheckboxes :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, XMLGenerator x, StringType x ~ Text, EmbedAsChild x lbl, EmbedAsAttr x (Attr Text FormId)) => [(a, lbl)] -> (a -> Bool) -> Form m input error [XMLGenT x (XMLType x)] () [a]
- inputRadio :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, XMLGenerator x, StringType x ~ Text, EmbedAsChild x lbl, EmbedAsAttr x (Attr Text FormId)) => [(a, lbl)] -> (a -> Bool) -> Form m input error [XMLGenT x (XMLType x)] () a
- inputRadioForms :: forall m x error input lbl proof a. (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, XMLGenerator x, StringType x ~ Text, EmbedAsChild x lbl, EmbedAsAttr x (Attr Text FormId)) => [(Form m input error [XMLGenT x (XMLType x)] proof a, lbl)] -> a -> Form m input error [XMLGenT x (XMLType x)] proof a
- inputRadioForms' :: forall m x error input lbl proof a. (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, XMLGenerator x, StringType x ~ Text, EmbedAsChild x lbl, EmbedAsAttr x (Attr Text FormId)) => (FormId -> FormId -> [FormId] -> Text) -> [(Form m input error [XMLGenT x (XMLType x)] proof a, lbl)] -> a -> Form m input error [XMLGenT x (XMLType x)] proof a
- select :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, XMLGenerator x, StringType x ~ Text, EmbedAsChild x lbl, EmbedAsAttr x (Attr Text FormId)) => [(a, lbl)] -> (a -> Bool) -> Form m input error [XMLGenT x (XMLType x)] () a
- selectMultiple :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, XMLGenerator x, StringType x ~ Text, EmbedAsChild x lbl, EmbedAsAttr x (Attr Text FormId)) => [(a, lbl)] -> (a -> Bool) -> Form m input error [XMLGenT x (XMLType x)] () [a]
- errorList :: (Monad m, XMLGenerator x, StringType x ~ Text, EmbedAsChild x error) => Form m input error [XMLGenT x (XMLType x)] () ()
- childErrorList :: (Monad m, XMLGenerator x, StringType x ~ Text, EmbedAsChild x error) => Form m input error [XMLGenT x (XMLType x)] () ()
- br :: (Monad m, XMLGenerator x, StringType x ~ Text) => Form m input error [XMLGenT x (XMLType x)] () ()
- fieldset :: (Monad m, Functor m, XMLGenerator x, StringType x ~ Text, EmbedAsChild x c) => Form m input error c proof a -> Form m input error [XMLGenT x (XMLType x)] proof a
- ol :: (Monad m, Functor m, XMLGenerator x, StringType x ~ Text, EmbedAsChild x c) => Form m input error c proof a -> Form m input error [XMLGenT x (XMLType x)] proof a
- ul :: (Monad m, Functor m, XMLGenerator x, StringType x ~ Text, EmbedAsChild x c) => Form m input error c proof a -> Form m input error [XMLGenT x (XMLType x)] proof a
- li :: (Monad m, Functor m, XMLGenerator x, StringType x ~ Text, EmbedAsChild x c) => Form m input error c proof a -> Form m input error [XMLGenT x (XMLType x)] proof a
- form :: (XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text action)) => action -> [(Text, Text)] -> [XMLGenT x (XMLType x)] -> [XMLGenT x (XMLType x)]
- setAttrs :: (EmbedAsAttr x attr, XMLGenerator x, StringType x ~ Text, Monad m, Functor m) => Form m input error [GenXML x] proof a -> attr -> Form m input error [GenXML x] proof a

# Documentation

inputText :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => (input -> Either error text) -> text -> Form m input error [XMLGenT x (XMLType x)] () text Source #

inputEmail :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => (input -> Either error text) -> text -> Form m input error [XMLGenT x (XMLType x)] () text Source #

inputPassword :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => (input -> Either error text) -> text -> Form m input error [XMLGenT x (XMLType x)] () text Source #

inputSubmit :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => (input -> Either error text) -> text -> Form m input error [XMLGenT x (XMLType x)] () (Maybe text) Source #

inputReset :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => text -> Form m input error [XMLGenT x (XMLType x)] () () Source #

inputHidden :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => (input -> Either error text) -> text -> Form m input error [XMLGenT x (XMLType x)] () text Source #

inputButton :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => text -> Form m input error [XMLGenT x (XMLType x)] () () Source #

textarea Source #

Arguments

:: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsChild x text) |
=> (input -> Either error text) |
-> Int | cols
-> Int | rows
-> text | initial text
-> Form m input error [XMLGenT x (XMLType x)] () text |

inputFile :: (Monad m, FormError error, FormInput input, ErrorInputType error ~ input, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId)) => Form m input error [XMLGenT x (XMLType x)] () (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, XMLGenerator x, StringType x ~ Text, EmbedAsChild x children, EmbedAsAttr x (Attr Text FormId), EmbedAsAttr x (Attr Text text)) => (input -> Either error text) -> text -> children -> Form m input error [XMLGenT x (XMLType x)] () (Maybe text) Source #

Create a `<button type="submit">` element

buttonReset :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsChild x children, EmbedAsAttr x (Attr Text FormId)) => children -> Form m input error [XMLGenT x (XMLType x)] () () Source #

button :: (Monad m, FormError error, XMLGenerator x, StringType x ~ Text, EmbedAsChild x children, EmbedAsAttr x (Attr Text FormId)) => children -> Form m input error [XMLGenT x (XMLType x)] () () Source #

label :: (Monad m, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId), EmbedAsChild x c) => c -> Form m input error [XMLGenT x (XMLType x)] () () Source #

inputCheckbox Source #

Arguments

:: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input, XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text FormId)) |
=> Bool | initially checked
-> Form m input error [XMLGenT x (XMLType x)] () Bool |

inputCheckboxes Source #

Arguments

:: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, XMLGenerator x, StringType x ~ Text, EmbedAsChild x lbl, EmbedAsAttr x (Attr Text FormId)) |
=> [(a, lbl)] | value, label, initially checked
-> (a -> Bool) | function which indicates if a value should be checked initially
-> Form m input error [XMLGenT x (XMLType x)] () [a] |

inputRadio Source #

Arguments

:: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, XMLGenerator x, StringType x ~ Text, EmbedAsChild x lbl, EmbedAsAttr x (Attr Text FormId)) |
=> [(a, lbl)] | value, label, initially checked
-> (a -> Bool) | isDefault
-> Form m input error [XMLGenT x (XMLType x)] () a |

inputRadioForms Source #

Arguments

:: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, XMLGenerator x, StringType x ~ Text, EmbedAsChild x lbl, EmbedAsAttr x (Attr Text FormId)) |
=> [(Form m input error [XMLGenT x (XMLType x)] proof a, lbl)] | value, label, initially checked
-> a | default
-> Form m input error [XMLGenT x (XMLType x)] proof a |

inputRadioForms' Source #

Arguments

:: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, XMLGenerator x, StringType x ~ Text, EmbedAsChild x lbl, EmbedAsAttr x (Attr Text FormId)) |
=> (FormId -> FormId -> [FormId] -> Text) |
-> [(Form m input error [XMLGenT x (XMLType x)] proof a, lbl)] | value, label, initially checked
-> a | default
-> Form m input error [XMLGenT x (XMLType x)] proof a |

select Source #

Arguments

:: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, XMLGenerator x, StringType x ~ Text, EmbedAsChild x lbl, EmbedAsAttr x (Attr Text FormId)) |
=> [(a, lbl)] | value, label
-> (a -> Bool) | isDefault, must match *exactly one* element in the list of choices
-> Form m input error [XMLGenT x (XMLType x)] () a |

selectMultiple Source #

Arguments

:: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, XMLGenerator x, StringType x ~ Text, EmbedAsChild x lbl, EmbedAsAttr x (Attr Text FormId)) |
=> [(a, lbl)] | value, label, initially checked
-> (a -> Bool) | isSelected initially
-> Form m input error [XMLGenT x (XMLType x)] () [a] |

errorList :: (Monad m, XMLGenerator x, StringType x ~ Text, EmbedAsChild x error) => Form m input error [XMLGenT x (XMLType x)] () () Source #

childErrorList :: (Monad m, XMLGenerator x, StringType x ~ Text, EmbedAsChild x error) => Form m input error [XMLGenT x (XMLType x)] () () Source #

br :: (Monad m, XMLGenerator x, StringType x ~ Text) => Form m input error [XMLGenT x (XMLType x)] () () Source #

fieldset :: (Monad m, Functor m, XMLGenerator x, StringType x ~ Text, EmbedAsChild x c) => Form m input error c proof a -> Form m input error [XMLGenT x (XMLType x)] proof a Source #

ol :: (Monad m, Functor m, XMLGenerator x, StringType x ~ Text, EmbedAsChild x c) => Form m input error c proof a -> Form m input error [XMLGenT x (XMLType x)] proof a Source #

ul :: (Monad m, Functor m, XMLGenerator x, StringType x ~ Text, EmbedAsChild x c) => Form m input error c proof a -> Form m input error [XMLGenT x (XMLType x)] proof a Source #

li :: (Monad m, Functor m, XMLGenerator x, StringType x ~ Text, EmbedAsChild x c) => Form m input error c proof a -> Form m input error [XMLGenT x (XMLType x)] proof a Source #

form Source #

Arguments

:: (XMLGenerator x, StringType x ~ Text, EmbedAsAttr x (Attr Text action)) |
=> action | action url
-> [(Text, Text)] | hidden fields to add to form
-> [XMLGenT x (XMLType x)] | children
-> [XMLGenT x (XMLType x)] |

create `<form action=action method="POST" enctype="multipart/form-data">`

setAttrs :: (EmbedAsAttr x attr, XMLGenerator x, StringType x ~ Text, Monad m, Functor m) => Form m input error [GenXML x] proof a -> attr -> Form m input error [GenXML x] proof a Source #

# Orphan instances

(XMLGen m, EmbedAsAttr m (Attr Text Text)) => EmbedAsAttr m (Attr Text FormId) Source # |
Methods asAttr :: Attr Text FormId -> GenAttributeList m #