{-# LANGUAGE RankNTypes, TypeFamilies #-}
module Text.Reform.Hamlet.String
(
inputText
, inputPassword
, inputSubmit
, inputReset
, inputHidden
, inputButton
, inputCheckbox
, inputCheckboxes
, inputRadio
, inputFile
, textarea
, buttonSubmit
, buttonReset
, button
, select
, selectMultiple
, label
, errorList
, childErrorList
, br
, fieldset
, ol
, ul
, li
, form
) where
import Data.Text.Lazy (Text, pack)
import Text.Blaze (ToMarkup(..))
import Text.Reform
import qualified Text.Reform.Hamlet.Common as C
import Text.Hamlet (HtmlUrl)
inputText :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
String
-> Form m input error (HtmlUrl url) () String
inputText :: String -> Form m input error (HtmlUrl url) () String
inputText String
initialValue = (input -> Either error String)
-> String -> Form m input error (HtmlUrl url) () String
forall error (m :: * -> *) text input url.
(FormError error, Monad m, ToMarkup text) =>
(input -> Either error text)
-> text -> Form m input error (HtmlUrl url) () text
C.inputText input -> Either error String
forall input error.
(FormInput input, FormError error, ErrorInputType error ~ input) =>
input -> Either error String
getInputString String
initialValue
inputPassword :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
Form m input error (HtmlUrl url) () String
inputPassword :: Form m input error (HtmlUrl url) () String
inputPassword = (input -> Either error String)
-> String -> Form m input error (HtmlUrl url) () String
forall (m :: * -> *) error text input url.
(Monad m, FormError error, ToMarkup text) =>
(input -> Either error text)
-> text -> Form m input error (HtmlUrl url) () text
C.inputPassword input -> Either error String
forall input error.
(FormInput input, FormError error, ErrorInputType error ~ input) =>
input -> Either error String
getInputString String
""
inputSubmit :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
String
-> Form m input error (HtmlUrl url) () (Maybe String)
inputSubmit :: String -> Form m input error (HtmlUrl url) () (Maybe String)
inputSubmit String
initialValue = (input -> Either error String)
-> String -> Form m input error (HtmlUrl url) () (Maybe String)
forall (m :: * -> *) error text input url.
(Monad m, FormError error, ToMarkup text) =>
(input -> Either error text)
-> text -> Form m input error (HtmlUrl url) () (Maybe text)
C.inputSubmit input -> Either error String
forall input error.
(FormInput input, FormError error, ErrorInputType error ~ input) =>
input -> Either error String
getInputString String
initialValue
inputReset :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
String
-> Form m input error (HtmlUrl url) () ()
inputReset :: String -> Form m input error (HtmlUrl url) () ()
inputReset = String -> Form m input error (HtmlUrl url) () ()
forall (m :: * -> *) error text input url.
(Monad m, FormError error, ToMarkup text) =>
text -> Form m input error (HtmlUrl url) () ()
C.inputReset
inputHidden :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
String
-> Form m input error (HtmlUrl url) () String
inputHidden :: String -> Form m input error (HtmlUrl url) () String
inputHidden String
initialValue = (input -> Either error String)
-> String -> Form m input error (HtmlUrl url) () String
forall (m :: * -> *) error text input url.
(Monad m, FormError error, ToMarkup text) =>
(input -> Either error text)
-> text -> Form m input error (HtmlUrl url) () text
C.inputHidden input -> Either error String
forall input error.
(FormInput input, FormError error, ErrorInputType error ~ input) =>
input -> Either error String
getInputString String
initialValue
inputButton :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
String
-> Form m input error (HtmlUrl url) () ()
inputButton :: String -> Form m input error (HtmlUrl url) () ()
inputButton String
label = String -> Form m input error (HtmlUrl url) () ()
forall (m :: * -> *) error text input url.
(Monad m, FormError error, ToMarkup text) =>
text -> Form m input error (HtmlUrl url) () ()
C.inputButton String
label
textarea :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
Int
-> Int
-> String
-> Form m input error (HtmlUrl url) () String
textarea :: Int -> Int -> String -> Form m input error (HtmlUrl url) () String
textarea Int
rows Int
cols String
initialValue = (input -> Either error String)
-> Int
-> Int
-> String
-> Form m input error (HtmlUrl url) () String
forall (m :: * -> *) error text input url.
(Monad m, FormError error, ToMarkup text) =>
(input -> Either error text)
-> Int -> Int -> text -> Form m input error (HtmlUrl url) () text
C.textarea input -> Either error String
forall input error.
(FormInput input, FormError error, ErrorInputType error ~ input) =>
input -> Either error String
getInputString Int
rows Int
cols String
initialValue
buttonSubmit :: ( Monad m, FormError error, FormInput input, ErrorInputType error ~ input, ToMarkup children) =>
String
-> children
-> Form m input error (HtmlUrl url) () (Maybe String)
buttonSubmit :: String
-> children -> Form m input error (HtmlUrl url) () (Maybe String)
buttonSubmit = (input -> Either error String)
-> String
-> children
-> Form m input error (HtmlUrl url) () (Maybe String)
forall (m :: * -> *) error text children input url.
(Monad m, FormError error, ToMarkup text, ToMarkup children) =>
(input -> Either error text)
-> text
-> children
-> Form m input error (HtmlUrl url) () (Maybe text)
C.buttonSubmit input -> Either error String
forall input error.
(FormInput input, FormError error, ErrorInputType error ~ input) =>
input -> Either error String
getInputString
inputCheckbox :: forall x error input m url. (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
Bool
-> Form m input error (HtmlUrl url) () Bool
inputCheckbox :: Bool -> Form m input error (HtmlUrl url) () Bool
inputCheckbox = Bool -> Form m input error (HtmlUrl url) () Bool
forall x error input (m :: * -> *) url.
(Monad m, FormInput input, FormError error,
ErrorInputType error ~ input) =>
Bool -> Form m input error (HtmlUrl url) () Bool
C.inputCheckbox
inputCheckboxes :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToMarkup lbl) =>
[(a, lbl)]
-> (a -> Bool)
-> Form m input error (HtmlUrl url) () [a]
inputCheckboxes :: [(a, lbl)]
-> (a -> Bool) -> Form m input error (HtmlUrl url) () [a]
inputCheckboxes = [(a, lbl)]
-> (a -> Bool) -> Form m input error (HtmlUrl url) () [a]
forall (m :: * -> *) error input lbl a url.
(Functor m, Monad m, FormError error, ErrorInputType error ~ input,
FormInput input, ToMarkup lbl) =>
[(a, lbl)]
-> (a -> Bool) -> Form m input error (HtmlUrl url) () [a]
C.inputCheckboxes
inputRadio :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToMarkup lbl) =>
[(a, lbl)]
-> (a -> Bool)
-> Form m input error (HtmlUrl url) () a
inputRadio :: [(a, lbl)] -> (a -> Bool) -> Form m input error (HtmlUrl url) () a
inputRadio = [(a, lbl)] -> (a -> Bool) -> Form m input error (HtmlUrl url) () a
forall (m :: * -> *) error input lbl a url.
(Functor m, Monad m, FormError error, ErrorInputType error ~ input,
FormInput input, ToMarkup lbl) =>
[(a, lbl)] -> (a -> Bool) -> Form m input error (HtmlUrl url) () a
C.inputRadio
inputFile :: (Monad m, FormError error, FormInput input, ErrorInputType error ~ input) =>
Form m input error (HtmlUrl url) () (FileType input)
inputFile :: Form m input error (HtmlUrl url) () (FileType input)
inputFile = Form m input error (HtmlUrl url) () (FileType input)
forall (m :: * -> *) error input url.
(Monad m, FormError error, FormInput input,
ErrorInputType error ~ input) =>
Form m input error (HtmlUrl url) () (FileType input)
C.inputFile
buttonReset :: (Monad m, FormError error, ToMarkup children) =>
children
-> Form m input error (HtmlUrl url) () ()
buttonReset :: children -> Form m input error (HtmlUrl url) () ()
buttonReset = children -> Form m input error (HtmlUrl url) () ()
forall (m :: * -> *) error text input url.
(Monad m, FormError error, ToMarkup text) =>
text -> Form m input error (HtmlUrl url) () ()
C.buttonReset
button :: ( Monad m, FormError error, FormInput input, ErrorInputType error ~ input, ToMarkup children) =>
children
-> Form m input error (HtmlUrl url) () ()
button :: children -> Form m input error (HtmlUrl url) () ()
button = children -> Form m input error (HtmlUrl url) () ()
forall (m :: * -> *) error text input url.
(Monad m, FormError error, ToMarkup text) =>
text -> Form m input error (HtmlUrl url) () ()
C.button
select :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToMarkup lbl) =>
[(a, lbl)]
-> (a -> Bool)
-> Form m input error (HtmlUrl url) () a
select :: [(a, lbl)] -> (a -> Bool) -> Form m input error (HtmlUrl url) () a
select = [(a, lbl)] -> (a -> Bool) -> Form m input error (HtmlUrl url) () a
forall (m :: * -> *) error input lbl a url.
(Functor m, Monad m, FormError error, ErrorInputType error ~ input,
FormInput input, ToMarkup lbl) =>
[(a, lbl)] -> (a -> Bool) -> Form m input error (HtmlUrl url) () a
C.select
selectMultiple :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToMarkup lbl) =>
[(a, lbl)]
-> (a -> Bool)
-> Form m input error (HtmlUrl url) () [a]
selectMultiple :: [(a, lbl)]
-> (a -> Bool) -> Form m input error (HtmlUrl url) () [a]
selectMultiple = [(a, lbl)]
-> (a -> Bool) -> Form m input error (HtmlUrl url) () [a]
forall (m :: * -> *) error input lbl a url.
(Functor m, Monad m, FormError error, ErrorInputType error ~ input,
FormInput input, ToMarkup lbl) =>
[(a, lbl)]
-> (a -> Bool) -> Form m input error (HtmlUrl url) () [a]
C.selectMultiple
label :: (Monad m, ToMarkup c) =>
c
-> Form m input error (HtmlUrl url) () ()
label :: c -> Form m input error (HtmlUrl url) () ()
label = c -> Form m input error (HtmlUrl url) () ()
forall (m :: * -> *) c input error url.
(Monad m, ToMarkup c) =>
c -> Form m input error (HtmlUrl url) () ()
C.label
errorList :: (Monad m, ToMarkup error) =>
Form m input error (HtmlUrl url) () ()
errorList :: Form m input error (HtmlUrl url) () ()
errorList = Form m input error (HtmlUrl url) () ()
forall (m :: * -> *) error input url.
(Monad m, ToMarkup error) =>
Form m input error (HtmlUrl url) () ()
C.errorList
childErrorList :: (Monad m, ToMarkup error) =>
Form m input error (HtmlUrl url) () ()
childErrorList :: Form m input error (HtmlUrl url) () ()
childErrorList = Form m input error (HtmlUrl url) () ()
forall (m :: * -> *) error input url.
(Monad m, ToMarkup error) =>
Form m input error (HtmlUrl url) () ()
C.childErrorList
br :: (Monad m) => Form m input error (HtmlUrl url) () ()
br :: Form m input error (HtmlUrl url) () ()
br = Form m input error (HtmlUrl url) () ()
forall (m :: * -> *) input error url.
Monad m =>
Form m input error (HtmlUrl url) () ()
C.br
fieldset :: (Monad m, Functor m, ToMarkup c) =>
Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
fieldset :: Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
fieldset = Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
forall (m :: * -> *) c input error proof a url.
(Monad m, Functor m, ToMarkup c) =>
Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
C.fieldset
ol :: (Monad m, Functor m, ToMarkup c) =>
Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
ol :: Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
ol = Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
forall (m :: * -> *) c input error proof a url.
(Monad m, Functor m, ToMarkup c) =>
Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
C.ol
ul :: (Monad m, Functor m, ToMarkup c) =>
Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
ul :: Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
ul = Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
forall (m :: * -> *) c input error proof a url.
(Monad m, Functor m, ToMarkup c) =>
Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
C.ul
li :: (Monad m, Functor m, ToMarkup c) =>
Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
li :: Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
li = Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
forall (m :: * -> *) c input error proof a url.
(Monad m, Functor m, ToMarkup c) =>
Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
C.li
form :: ToMarkup action =>
action
-> [(Text, Text)]
-> (HtmlUrl url)
-> (HtmlUrl url)
form :: action -> [(Text, Text)] -> HtmlUrl url -> HtmlUrl url
form = action -> [(Text, Text)] -> HtmlUrl url -> HtmlUrl url
forall action url.
ToMarkup action =>
action -> [(Text, Text)] -> HtmlUrl url -> HtmlUrl url
C.form