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

Safe HaskellNone
LanguageHaskell98

Text.Reform.HSP.Common

Contents

Synopsis

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