{-# LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, UndecidableInstances, ViewPatterns #-}
module Text.Reform.Blaze.String
(
inputText
, inputPassword
, inputSubmit
, inputReset
, inputHidden
, inputButton
, C.inputCheckbox
, C.inputCheckboxes
, C.inputRadio
, C.inputFile
, textarea
, buttonSubmit
, C.buttonReset
, C.button
, C.select
, C.selectMultiple
, C.label
, C.errorList
, C.childErrorList
, C.br
, C.fieldset
, C.ol
, C.ul
, C.li
, C.form
) where
import Text.Blaze.Html (Html, ToMarkup)
import Text.Reform
import qualified Text.Reform.Blaze.Common as C
inputText :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
String
-> Form m input error Html () String
inputText :: String -> Form m input error Html () String
inputText String
initialValue = (input -> Either error String)
-> String -> Form m input error Html () String
forall (m :: * -> *) error text input.
(Monad m, FormError error, ToValue text) =>
(input -> Either error text)
-> text -> Form m input error Html () 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 Html () String
inputPassword :: Form m input error Html () String
inputPassword = (input -> Either error String)
-> String -> Form m input error Html () String
forall (m :: * -> *) error text input.
(Monad m, FormError error, ToValue text) =>
(input -> Either error text)
-> text -> Form m input error Html () 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 Html () (Maybe String)
inputSubmit :: String -> Form m input error Html () (Maybe String)
inputSubmit String
initialValue = (input -> Either error String)
-> String -> Form m input error Html () (Maybe String)
forall (m :: * -> *) error text input.
(Monad m, FormError error, ToValue text) =>
(input -> Either error text)
-> text -> Form m input error Html () (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 Html () ()
inputReset :: String -> Form m input error Html () ()
inputReset = String -> Form m input error Html () ()
forall (m :: * -> *) error text input.
(Monad m, FormError error, ToValue text) =>
text -> Form m input error Html () ()
C.inputReset
inputHidden :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
String
-> Form m input error Html () String
inputHidden :: String -> Form m input error Html () String
inputHidden String
initialValue = (input -> Either error String)
-> String -> Form m input error Html () String
forall (m :: * -> *) error text input.
(Monad m, FormError error, ToValue text) =>
(input -> Either error text)
-> text -> Form m input error Html () 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 Html () ()
inputButton :: String -> Form m input error Html () ()
inputButton String
label = String -> Form m input error Html () ()
forall (m :: * -> *) error text input.
(Monad m, FormError error, ToValue text) =>
text -> Form m input error Html () ()
C.inputButton String
label
textarea :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
Int
-> Int
-> String
-> Form m input error Html () String
textarea :: Int -> Int -> String -> Form m input error Html () String
textarea Int
rows Int
cols String
initialValue = (input -> Either error String)
-> Int -> Int -> String -> Form m input error Html () String
forall (m :: * -> *) error text input.
(Monad m, FormError error, ToMarkup text) =>
(input -> Either error text)
-> Int -> Int -> text -> Form m input error Html () 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 Html () (Maybe String)
buttonSubmit :: String -> children -> Form m input error Html () (Maybe String)
buttonSubmit = (input -> Either error String)
-> String -> children -> Form m input error Html () (Maybe String)
forall (m :: * -> *) error text children input.
(Monad m, FormError error, ToValue text, ToMarkup children) =>
(input -> Either error text)
-> text -> children -> Form m input error Html () (Maybe text)
C.buttonSubmit input -> Either error String
forall input error.
(FormInput input, FormError error, ErrorInputType error ~ input) =>
input -> Either error String
getInputString