-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Form handling support for Yesod Web Framework
--   
--   API docs and the README are available at
--   http://www.stackage.org/package/yesod-form. Third-party
--   packages which you can find useful: yesod-form-richtext -
--   richtext form fields (currently it provides only Summernote support).
@package yesod-form
@version 1.7.9

module Yesod.Form.Types

-- | The encoding type required by a form. The ToHtml instance
--   produces values that can be inserted directly into HTML.
data Enctype
UrlEncoded :: Enctype
Multipart :: Enctype

-- | A form can produce three different results: there was no data
--   available, the data was invalid, or there was a successful parse.
--   
--   The Applicative instance will concatenate the failure messages
--   in two FormResults. The Alternative instance will choose
--   FormFailure before FormSuccess, and FormMissing
--   last of all.
data FormResult a
FormMissing :: FormResult a
FormFailure :: [Text] -> FormResult a
FormSuccess :: a -> FormResult a
data FormMessage
MsgInvalidInteger :: Text -> FormMessage
MsgInvalidNumber :: Text -> FormMessage
MsgInvalidEntry :: Text -> FormMessage
MsgInvalidUrl :: Text -> FormMessage
MsgInvalidEmail :: Text -> FormMessage
MsgInvalidTimeFormat :: FormMessage
MsgInvalidHour :: Text -> FormMessage
MsgInvalidMinute :: Text -> FormMessage
MsgInvalidSecond :: Text -> FormMessage
MsgInvalidDay :: FormMessage
MsgCsrfWarning :: FormMessage
MsgValueRequired :: FormMessage
MsgInputNotFound :: Text -> FormMessage
MsgSelectNone :: FormMessage
MsgInvalidBool :: Text -> FormMessage
MsgBoolYes :: FormMessage
MsgBoolNo :: FormMessage
MsgDelete :: FormMessage
MsgInvalidHexColorFormat :: Text -> FormMessage
MsgInvalidDatetimeFormat :: Text -> FormMessage
type Env = Map Text [Text]
type FileEnv = Map Text [FileInfo]
data Ints
IntCons :: Int -> Ints -> Ints
IntSingle :: Int -> Ints

-- | MForm variant stacking a WriterT. The following code
--   example using a monadic form MForm:
--   
--   
--   formToAForm $ do
--     (field1F, field1V) <- mreq textField MsgField1 Nothing
--     (field2F, field2V) <- mreq (checkWith field1F textField) MsgField2 Nothing
--     (field3F, field3V) <- mreq (checkWith field1F textField) MsgField3 Nothing
--     return
--       ( MyForm <$> field1F <*> field2F <*> field3F
--       , [field1V, field2V, field3V]
--       )
--   
--   
--   Could be rewritten as follows using WForm:
--   
--   
--   wFormToAForm $ do
--     field1F <- wreq textField MsgField1 Nothing
--     field2F <- wreq (checkWith field1F textField) MsgField2 Nothing
--     field3F <- wreq (checkWith field1F textField) MsgField3 Nothing
--     return $ MyForm <$> field1F <*> field2F <*> field3F
--   
type WForm (m :: Type -> Type) a = MForm WriterT [FieldView HandlerSite m] m a
type MForm (m :: Type -> Type) a = RWST (Maybe (Env, FileEnv), HandlerSite m, [Lang]) Enctype Ints m a
newtype AForm (m :: Type -> Type) a
AForm :: ((HandlerSite m, [Text]) -> Maybe (Env, FileEnv) -> Ints -> m (FormResult a, [FieldView (HandlerSite m)] -> [FieldView (HandlerSite m)], Ints, Enctype)) -> AForm (m :: Type -> Type) a
[unAForm] :: AForm (m :: Type -> Type) a -> (HandlerSite m, [Text]) -> Maybe (Env, FileEnv) -> Ints -> m (FormResult a, [FieldView (HandlerSite m)] -> [FieldView (HandlerSite m)], Ints, Enctype)
data Field (m :: Type -> Type) a
Field :: ([Text] -> [FileInfo] -> m (Either (SomeMessage (HandlerSite m)) (Maybe a))) -> FieldViewFunc m a -> Enctype -> Field (m :: Type -> Type) a
[fieldParse] :: Field (m :: Type -> Type) a -> [Text] -> [FileInfo] -> m (Either (SomeMessage (HandlerSite m)) (Maybe a))
[fieldView] :: Field (m :: Type -> Type) a -> FieldViewFunc m a
[fieldEnctype] :: Field (m :: Type -> Type) a -> Enctype
data FieldSettings master
FieldSettings :: SomeMessage master -> Maybe (SomeMessage master) -> Maybe Text -> Maybe Text -> [(Text, Text)] -> FieldSettings master
[fsLabel] :: FieldSettings master -> SomeMessage master
[fsTooltip] :: FieldSettings master -> Maybe (SomeMessage master)
[fsId] :: FieldSettings master -> Maybe Text
[fsName] :: FieldSettings master -> Maybe Text
[fsAttrs] :: FieldSettings master -> [(Text, Text)]
data FieldView site
FieldView :: Markup -> Maybe Markup -> Text -> WidgetFor site () -> Maybe Markup -> Bool -> FieldView site
[fvLabel] :: FieldView site -> Markup
[fvTooltip] :: FieldView site -> Maybe Markup
[fvId] :: FieldView site -> Text
[fvInput] :: FieldView site -> WidgetFor site ()
[fvErrors] :: FieldView site -> Maybe Markup
[fvRequired] :: FieldView site -> Bool
type FieldViewFunc (m :: Type -> Type) a = Text -> Text -> [(Text, Text)] -> Either Text a -> Bool -> WidgetFor HandlerSite m ()
instance GHC.Internal.Base.Alternative Yesod.Form.Types.FormResult
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Applicative (Yesod.Form.Types.AForm m)
instance GHC.Internal.Base.Applicative Yesod.Form.Types.FormResult
instance GHC.Internal.Enum.Bounded Yesod.Form.Types.Enctype
instance GHC.Internal.Enum.Enum Yesod.Form.Types.Enctype
instance GHC.Classes.Eq Yesod.Form.Types.Enctype
instance GHC.Classes.Eq Yesod.Form.Types.FormMessage
instance GHC.Classes.Eq a => GHC.Classes.Eq (Yesod.Form.Types.FormResult a)
instance GHC.Internal.Data.Foldable.Foldable Yesod.Form.Types.FormResult
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Functor (Yesod.Form.Types.AForm m)
instance GHC.Internal.Base.Functor Yesod.Form.Types.FormResult
instance GHC.Internal.Data.String.IsString (Yesod.Form.Types.FieldSettings a)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Monad (Yesod.Form.Types.AForm m)
instance Control.Monad.Trans.Class.MonadTrans Yesod.Form.Types.AForm
instance (GHC.Internal.Base.Monad m, GHC.Internal.Base.Monoid a) => GHC.Internal.Base.Monoid (Yesod.Form.Types.AForm m a)
instance GHC.Internal.Base.Monoid Yesod.Form.Types.Enctype
instance GHC.Internal.Base.Monoid m => GHC.Internal.Base.Monoid (Yesod.Form.Types.FormResult m)
instance GHC.Internal.Read.Read Yesod.Form.Types.FormMessage
instance (GHC.Internal.Base.Monad m, GHC.Internal.Base.Semigroup a) => GHC.Internal.Base.Semigroup (Yesod.Form.Types.AForm m a)
instance GHC.Internal.Base.Semigroup Yesod.Form.Types.Enctype
instance GHC.Internal.Base.Semigroup m => GHC.Internal.Base.Semigroup (Yesod.Form.Types.FormResult m)
instance GHC.Internal.Show.Show Yesod.Form.Types.FormMessage
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Yesod.Form.Types.FormResult a)
instance GHC.Internal.Show.Show Yesod.Form.Types.Ints
instance Text.Blaze.ToMarkup Yesod.Form.Types.Enctype
instance Text.Blaze.ToValue Yesod.Form.Types.Enctype
instance GHC.Internal.Data.Traversable.Traversable Yesod.Form.Types.FormResult

-- | Provides for getting input from either GET or POST params without
--   generating HTML forms. For more information, see:
--   http://www.yesodweb.com/book/forms#forms_kinds_of_forms.
module Yesod.Form.Input

-- | Type for a form which parses a value of type a with the base
--   monad m (usually your Handler). Can compose this
--   using its Applicative instance.
newtype FormInput (m :: Type -> Type) a
FormInput :: (HandlerSite m -> [Text] -> Env -> FileEnv -> m (Either DText a)) -> FormInput (m :: Type -> Type) a
[unFormInput] :: FormInput (m :: Type -> Type) a -> HandlerSite m -> [Text] -> Env -> FileEnv -> m (Either DText a)

-- | Run a FormInput on the GET parameters (i.e., query string).
--   If parsing fails, calls invalidArgs.
runInputGet :: MonadHandler m => FormInput m a -> m a

-- | Run a FormInput on the GET parameters (i.e., query string).
--   Does not throw exceptions on failure.
--   
--   Since 1.4.1
runInputGetResult :: MonadHandler m => FormInput m a -> m (FormResult a)

-- | Run a FormInput on the POST parameters (i.e., request body).
--   If parsing fails, calls invalidArgs.
runInputPost :: MonadHandler m => FormInput m a -> m a

-- | Run a FormInput on the POST parameters (i.e., request body).
--   Does not throw exceptions on failure.
runInputPostResult :: MonadHandler m => FormInput m a -> m (FormResult a)

-- | Promote a Field into a FormInput, requiring that the
--   value be present and valid.
ireq :: forall (m :: Type -> Type) a. (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m a -> Text -> FormInput m a

-- | Promote a Field into a FormInput, with its presence
--   being optional. If the value is present but does not parse correctly,
--   the form will still fail.
iopt :: forall (m :: Type -> Type) a. Monad m => Field m a -> Text -> FormInput m (Maybe a)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Applicative (Yesod.Form.Input.FormInput m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Functor (Yesod.Form.Input.FormInput m)

module Yesod.Form.I18n.Swedish
swedishFormMessage :: FormMessage -> Text

module Yesod.Form.I18n.Spanish
spanishFormMessage :: FormMessage -> Text

module Yesod.Form.I18n.Russian
russianFormMessage :: FormMessage -> Text

module Yesod.Form.I18n.Romanian

-- | Romanian translation
romanianFormMessage :: FormMessage -> Text

module Yesod.Form.I18n.Portuguese
portugueseFormMessage :: FormMessage -> Text

module Yesod.Form.I18n.Norwegian
norwegianBokmålFormMessage :: FormMessage -> Text

module Yesod.Form.I18n.Korean
koreanFormMessage :: FormMessage -> Text

module Yesod.Form.I18n.Japanese
japaneseFormMessage :: FormMessage -> Text

module Yesod.Form.I18n.German
germanFormMessage :: FormMessage -> Text

module Yesod.Form.I18n.French
frenchFormMessage :: FormMessage -> Text

module Yesod.Form.I18n.English
englishFormMessage :: FormMessage -> Text

module Yesod.Form.I18n.Dutch
dutchFormMessage :: FormMessage -> Text

module Yesod.Form.I18n.Czech
czechFormMessage :: FormMessage -> Text

module Yesod.Form.I18n.Chinese
chineseFormMessage :: FormMessage -> Text

module Yesod.Form.Functions

-- | Get a unique identifier.
newFormIdent :: forall (m :: Type -> Type). Monad m => MForm m Text
askParams :: forall (m :: Type -> Type). Monad m => MForm m (Maybe Env)
askFiles :: forall (m :: Type -> Type). Monad m => MForm m (Maybe FileEnv)
formToAForm :: forall (m :: Type -> Type) site a. (HandlerSite m ~ site, Monad m) => MForm m (FormResult a, [FieldView site]) -> AForm m a
aFormToForm :: forall (m :: Type -> Type) site a. (Monad m, HandlerSite m ~ site) => AForm m a -> MForm m (FormResult a, [FieldView site] -> [FieldView site])

-- | Converts a monadic form MForm into another monadic form
--   WForm.
mFormToWForm :: forall (m :: Type -> Type) site a. (MonadHandler m, HandlerSite m ~ site) => MForm m (a, FieldView site) -> WForm m a

-- | Converts a monadic form WForm into an applicative form
--   AForm.
wFormToAForm :: forall (m :: Type -> Type) a. MonadHandler m => WForm m (FormResult a) -> AForm m a

-- | Converts a monadic form WForm into another monadic form
--   MForm.
wFormToMForm :: forall (m :: Type -> Type) site a. (MonadHandler m, HandlerSite m ~ site) => WForm m a -> MForm m (a, [FieldView site])

-- | Converts a form field into monadic form WForm. This field
--   requires a value and will return FormFailure if left empty.
wreq :: forall site (m :: Type -> Type) a. (RenderMessage site FormMessage, HandlerSite m ~ site, MonadHandler m) => Field m a -> FieldSettings site -> Maybe a -> WForm m (FormResult a)

-- | Same as wreq but with your own message to be rendered in case
--   the value is not provided.
--   
--   This is useful when you have several required fields on the page and
--   you want to differentiate between which fields were left blank.
--   Otherwise the user sees "Value is required" multiple times, which is
--   ambiguous.
wreqMsg :: forall site msg (m :: Type -> Type) a. (RenderMessage site msg, HandlerSite m ~ site, MonadHandler m) => Field m a -> FieldSettings site -> msg -> Maybe a -> WForm m (FormResult a)

-- | Converts a form field into monadic form WForm. This field is
--   optional, i.e. if filled in, it returns 'Just a', if left empty, it
--   returns Nothing. Arguments are the same as for wreq
--   (apart from type of default value).
wopt :: forall (m :: Type -> Type) site a. (MonadHandler m, HandlerSite m ~ site) => Field m a -> FieldSettings site -> Maybe (Maybe a) -> WForm m (FormResult (Maybe a))

-- | Converts a form field into monadic form. This field requires a value
--   and will return FormFailure if left empty.
mreq :: forall site (m :: Type -> Type) a. (RenderMessage site FormMessage, HandlerSite m ~ site, MonadHandler m) => Field m a -> FieldSettings site -> Maybe a -> MForm m (FormResult a, FieldView site)

-- | Same as mreq but with your own message to be rendered in case
--   the value is not provided.
--   
--   This is useful when you have several required fields on the page and
--   you want to differentiate between which fields were left blank.
--   Otherwise the user sees "Value is required" multiple times, which is
--   ambiguous.
mreqMsg :: forall site msg (m :: Type -> Type) a. (RenderMessage site msg, HandlerSite m ~ site, MonadHandler m) => Field m a -> FieldSettings site -> msg -> Maybe a -> MForm m (FormResult a, FieldView site)

-- | Converts a form field into monadic form. This field is optional, i.e.
--   if filled in, it returns 'Just a', if left empty, it returns
--   Nothing. Arguments are the same as for mreq (apart from
--   type of default value).
mopt :: forall site (m :: Type -> Type) a. (site ~ HandlerSite m, MonadHandler m) => Field m a -> FieldSettings site -> Maybe (Maybe a) -> MForm m (FormResult (Maybe a), FieldView site)

-- | Applicative equivalent of mreq.
areq :: forall site (m :: Type -> Type) a. (RenderMessage site FormMessage, HandlerSite m ~ site, MonadHandler m) => Field m a -> FieldSettings site -> Maybe a -> AForm m a

-- | Same as areq but with your own message to be rendered in case
--   the value is not provided.
--   
--   This is useful when you have several required fields on the page and
--   you want to differentiate between which fields were left blank.
--   Otherwise the user sees "Value is required" multiple times, which is
--   ambiguous.
areqMsg :: forall site msg (m :: Type -> Type) a. (RenderMessage site msg, HandlerSite m ~ site, MonadHandler m) => Field m a -> FieldSettings site -> msg -> Maybe a -> AForm m a

-- | Applicative equivalent of mopt.
aopt :: forall (m :: Type -> Type) a. MonadHandler m => Field m a -> FieldSettings (HandlerSite m) -> Maybe (Maybe a) -> AForm m (Maybe a)

-- | This function is used to both initially render a form and to later
--   extract results from it. Note that, due to CSRF protection and a few
--   other issues, forms submitted via GET and POST are slightly different.
--   As such, be sure to call the relevant function based on how the form
--   will be submitted, not the current request method.
--   
--   For example, a common case is displaying a form on a GET request and
--   having the form submit to a POST page. In such a case, both the GET
--   and POST handlers should use runFormPost.
runFormPost :: (RenderMessage (HandlerSite m) FormMessage, MonadResource m, MonadHandler m) => (Markup -> MForm m (FormResult a, xml)) -> m ((FormResult a, xml), Enctype)
runFormPostNoToken :: MonadHandler m => (Markup -> MForm m a) -> m (a, Enctype)
runFormGet :: MonadHandler m => (Markup -> MForm m a) -> m (a, Enctype)

-- | Similar to runFormPost, except it always ignores the currently
--   available environment. This is necessary in cases like a wizard UI,
--   where a single page will both receive and incoming form and produce a
--   new, blank form. For general usage, you can stick with
--   runFormPost.
generateFormPost :: (RenderMessage (HandlerSite m) FormMessage, MonadHandler m) => (Markup -> MForm m (FormResult a, xml)) -> m (xml, Enctype)

-- | Since 1.3.11
generateFormGet' :: MonadHandler m => (Markup -> MForm m (FormResult a, xml)) -> m (xml, Enctype)

-- | Deprecated: Will require RenderMessage in next version of Yesod
generateFormGet :: MonadHandler m => (Markup -> MForm m a) -> m (a, Enctype)

-- | Creates a hidden field on the form that identifies it. This
--   identification is then used to distinguish between missing and
--   wrong form data when a single handler contains more than one
--   form.
--   
--   For instance, if you have the following code on your handler:
--   
--   
--   ((fooRes, fooWidget), fooEnctype) <- runFormPost fooForm
--   ((barRes, barWidget), barEnctype) <- runFormPost barForm
--   
--   
--   Then replace it with
--   
--   
--   ((fooRes, fooWidget), fooEnctype) <- runFormPost $ identifyForm "foo" fooForm
--   ((barRes, barWidget), barEnctype) <- runFormPost $ identifyForm "bar" barForm
--   
--   
--   Note that it's your responsibility to ensure that the identification
--   strings are unique (using the same one twice on a single handler will
--   not generate any errors). This allows you to create a variable number
--   of forms and still have them work even if their number or order change
--   between the HTML generation and the form submission.
identifyForm :: forall (m :: Type -> Type) a. Monad m => Text -> (Markup -> MForm m (FormResult a, WidgetFor (HandlerSite m) ())) -> Markup -> MForm m (FormResult a, WidgetFor (HandlerSite m) ())
type FormRender (m :: Type -> Type) a = AForm m a -> Markup -> MForm m (FormResult a, WidgetFor HandlerSite m ())

-- | Render a form into a series of tr tags. Note that, in order to allow
--   you to add extra rows to the table, this function does not wrap
--   up the resulting HTML in a table tag; you must do that yourself.
renderTable :: forall (m :: Type -> Type) a. Monad m => FormRender m a

-- | render a field inside a div
renderDivs :: forall (m :: Type -> Type) a. Monad m => FormRender m a

-- | render a field inside a div, not displaying any label
renderDivsNoLabels :: forall (m :: Type -> Type) a. Monad m => FormRender m a

-- | Deprecated synonym for renderBootstrap2.

-- | Deprecated: Please use the Yesod.Form.Bootstrap3 module.
renderBootstrap :: forall (m :: Type -> Type) a. Monad m => FormRender m a

-- | Render a form using Bootstrap v2-friendly shamlet syntax. If you're
--   using Bootstrap v3, then you should use the functions from module
--   Yesod.Form.Bootstrap3.
--   
--   Sample Hamlet:
--   
--   
--   <form .form-horizontal method=post action=@{ActionR} enctype=#{formEnctype}>
--     <fieldset>
--       <legend>_{MsgLegend}
--       $case result
--         $of FormFailure reasons
--           $forall reason <- reasons
--             <div .alert .alert-error>#{reason}
--         $of _
--       ^{formWidget}
--       <div .form-actions>
--         <input .btn .primary type=submit value=_{MsgSubmit}>
--   
--   
--   Since 1.3.14
renderBootstrap2 :: forall (m :: Type -> Type) a. Monad m => FormRender m a
check :: forall (m :: Type -> Type) msg a. (Monad m, RenderMessage (HandlerSite m) msg) => (a -> Either msg a) -> Field m a -> Field m a

-- | Return the given error message if the predicate is false.
checkBool :: forall (m :: Type -> Type) msg a. (Monad m, RenderMessage (HandlerSite m) msg) => (a -> Bool) -> msg -> Field m a -> Field m a
checkM :: (Monad m, RenderMessage (HandlerSite m) msg) => (a -> m (Either msg a)) -> Field m a -> Field m a

-- | Same as checkM, but modifies the datatype.
--   
--   In order to make this work, you must provide a function to convert
--   back from the new datatype to the old one (the second argument to this
--   function).
--   
--   Since 1.1.2
checkMMap :: (Monad m, RenderMessage (HandlerSite m) msg) => (a -> m (Either msg b)) -> (b -> a) -> Field m a -> Field m b

-- | Allows you to overwrite the error message on parse error.
customErrorMessage :: forall (m :: Type -> Type) a. Monad m => SomeMessage (HandlerSite m) -> Field m a -> Field m a

-- | Generate a FieldSettings from the given label.
fieldSettingsLabel :: RenderMessage site msg => msg -> FieldSettings site

-- | A helper function for creating custom fields.
--   
--   This is intended to help with the common case where a single input
--   value is required, such as when parsing a text field.
--   
--   Since 1.1
parseHelper :: (Monad m, RenderMessage site FormMessage) => (Text -> Either FormMessage a) -> [Text] -> [FileInfo] -> m (Either (SomeMessage site) (Maybe a))

-- | A generalized version of parseHelper, allowing any type for the
--   message indicating a bad parse.
--   
--   Since 1.3.6
parseHelperGen :: (Monad m, RenderMessage site msg) => (Text -> Either msg a) -> [Text] -> [FileInfo] -> m (Either (SomeMessage site) (Maybe a))

-- | Since a Field cannot be a Functor, it is not obvious how
--   to "reuse" a Field on a newtype or otherwise equivalent type.
--   This function allows you to convert a Field m a to a
--   Field m b assuming you provide a bidirectional conversion
--   between the two, through the first two functions.
--   
--   A simple example:
--   
--   
--   import Data.Monoid
--   sumField :: (Functor m, Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m (Sum Int)
--   sumField = convertField Sum getSum intField
--   
--   
--   Another example, not using a newtype, but instead creating a Lazy Text
--   field:
--   
--   
--   import qualified Data.Text.Lazy as TL
--   TextField :: (Functor m, Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m TL.Text
--   lazyTextField = convertField TL.fromStrict TL.toStrict textField
--   
--   
--   Since 1.3.16
convertField :: forall (m :: Type -> Type) a b. Functor m => (a -> b) -> (b -> a) -> Field m a -> Field m b

-- | Adds a CSS class to the fsAttrs in a FieldSettings.
--   
--   
Examples
--   
--   
--   >>> addClass "login-form" [("class", "form-control"), ("id", "home-login")]
--   [("class","form-control login-form"),("id","home-login")]
--   
addClass :: Text -> [(Text, Text)] -> [(Text, Text)]

-- | Removes a CSS class from the fsAttrs in a FieldSettings.
--   
--   
Examples
--   
--   
--   >>> removeClass "form-control" [("class","form-control login-form"),("id","home-login")]
--   [("class","  login-form"),("id","home-login")]
--   
removeClass :: Text -> [(Text, Text)] -> [(Text, Text)]

-- | Field functions allow you to easily create and validate forms, cleanly
--   handling the uncertainty of parsing user input.
--   
--   When possible, the field functions use a specific input type (e.g.
--   "number"), allowing supporting browsers to validate the input before
--   form submission. Browsers can also improve usability with this
--   information; for example, mobile browsers might present a specialized
--   keyboard for an input of type "email" or "number".
--   
--   See the Yesod book chapter on forms for a broader overview of
--   forms in Yesod.
module Yesod.Form.Fields
data FormMessage
MsgInvalidInteger :: Text -> FormMessage
MsgInvalidNumber :: Text -> FormMessage
MsgInvalidEntry :: Text -> FormMessage
MsgInvalidUrl :: Text -> FormMessage
MsgInvalidEmail :: Text -> FormMessage
MsgInvalidTimeFormat :: FormMessage
MsgInvalidHour :: Text -> FormMessage
MsgInvalidMinute :: Text -> FormMessage
MsgInvalidSecond :: Text -> FormMessage
MsgInvalidDay :: FormMessage
MsgCsrfWarning :: FormMessage
MsgValueRequired :: FormMessage
MsgInputNotFound :: Text -> FormMessage
MsgSelectNone :: FormMessage
MsgInvalidBool :: Text -> FormMessage
MsgBoolYes :: FormMessage
MsgBoolNo :: FormMessage
MsgDelete :: FormMessage
MsgInvalidHexColorFormat :: Text -> FormMessage
MsgInvalidDatetimeFormat :: Text -> FormMessage
defaultFormMessage :: FormMessage -> Text

-- | Creates a input with type="text".
textField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Text

-- | Creates an input with type="password".
passwordField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Text

-- | Creates a <textarea> tag whose returned value is
--   wrapped in a Textarea; see Textarea for details.
textareaField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Textarea

-- | Creates an input with type="hidden"; you can use this to
--   store information in a form that users shouldn't see (for example,
--   Yesod stores CSRF tokens in a hidden field).
hiddenField :: forall (m :: Type -> Type) p. (Monad m, PathPiece p, RenderMessage (HandlerSite m) FormMessage) => Field m p

-- | Creates a input with type="number" and step=1.
intField :: forall (m :: Type -> Type) i. (Monad m, Integral i, RenderMessage (HandlerSite m) FormMessage) => Field m i

-- | Creates an input with type="date", validating the input using
--   the parseDate function.
--   
--   Add the time package and import the Data.Time.Calendar
--   module to use this function.
dayField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Day

-- | An alias for timeFieldTypeTime.
timeField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m TimeOfDay

-- | Creates an input with type="time". Browsers not supporting
--   this type will fallback to a text field, and Yesod will parse the
--   time as described in timeFieldTypeText.
--   
--   Add the time package and import the
--   Data.Time.LocalTime module to use this function.
timeFieldTypeTime :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m TimeOfDay

-- | Creates an input with type="text", parsing the time from an
--   [H]H:MM[:SS] format, with an optional AM or PM (if not given, AM is
--   assumed for compatibility with the 24 hour clock system).
--   
--   This function exists for backwards compatibility with the old
--   implementation of timeField, which used to use
--   type="text". Consider using timeField or
--   timeFieldTypeTime for improved UX and validation from the
--   browser.
--   
--   Add the time package and import the
--   Data.Time.LocalTime module to use this function.
timeFieldTypeText :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m TimeOfDay

-- | Creates a <textarea> tag whose input is sanitized to
--   prevent XSS attacks and is validated for having balanced tags.
htmlField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Html

-- | Creates an input with type="email". Yesod will validate the
--   email's correctness according to RFC5322 and canonicalize it by
--   removing comments and whitespace (see Text.Email.Validate).
emailField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Text

-- | Creates an input with type="email" with the multiple
--   attribute; browsers might implement this as taking a comma separated
--   list of emails. Each email address is validated as described in
--   emailField.
multiEmailField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m [Text]

-- | Creates an input with type="search". For browsers without
--   autofocus support, a JS fallback is used if AutoFocus is
--   true.
searchField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => AutoFocus -> Field m Text
type AutoFocus = Bool

-- | Creates an input with type="url", validating the URL
--   according to RFC3986.
urlField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Text

-- | Creates a input with type="number" and step=any.
doubleField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Double

-- | Parses a Day from a String.
parseDate :: String -> Either FormMessage Day
parseTime :: Text -> Either FormMessage TimeOfDay

-- | A newtype wrapper around a Text whose ToMarkup instance
--   converts newlines to HTML <br> tags.
--   
--   (When text is entered into a <textarea>, newline
--   characters are used to separate lines. If this text is then placed
--   verbatim into HTML, the lines won't be separated, thus the need for
--   replacing with <br> tags). If you don't need this
--   functionality, simply use unTextarea to access the raw text.
newtype Textarea
Textarea :: Text -> Textarea
[unTextarea] :: Textarea -> Text

-- | Creates a group of radio buttons to answer the question given in the
--   message. Radio buttons are used to allow differentiating between an
--   empty response (Nothing) and a no response (Just
--   False). Consider using the simpler checkBoxField if you
--   don't need to make this distinction.
--   
--   If this field is optional, the first radio button is labeled
--   "<None>", the second "Yes" and the third "No".
--   
--   If this field is required, the first radio button is labeled "Yes" and
--   the second "No".
--   
--   (Exact label titles will depend on localization).
boolField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Bool

-- | Creates an input with type="checkbox". While the default
--   boolField implements a radio button so you can
--   differentiate between an empty response (Nothing) and a no
--   response (Just False), this simpler checkbox field returns an
--   empty response as Just False.
--   
--   Note that this makes the field always optional.
checkBoxField :: forall (m :: Type -> Type). Monad m => Field m Bool

-- | Creates an input with type="file".
fileField :: forall (m :: Type -> Type). Monad m => Field m FileInfo
fileAFormReq :: forall (m :: Type -> Type). (MonadHandler m, RenderMessage (HandlerSite m) FormMessage) => FieldSettings (HandlerSite m) -> AForm m FileInfo
fileAFormOpt :: forall (m :: Type -> Type). MonadHandler m => FieldSettings (HandlerSite m) -> AForm m (Maybe FileInfo)

-- | A helper function for constucting selectFields with optional
--   option groups. You may want to use this when you define your custom
--   selectFields or radioFields.
selectFieldHelper :: (Eq a, RenderMessage site FormMessage) => (Text -> Text -> [(Text, Text)] -> WidgetFor site () -> WidgetFor site ()) -> (Text -> Text -> Bool -> WidgetFor site ()) -> (Text -> Text -> [(Text, Text)] -> Text -> Bool -> Text -> WidgetFor site ()) -> Maybe (Text -> WidgetFor site ()) -> HandlerFor site (OptionList a) -> Field (HandlerFor site) a

-- | Creates a <select> tag with optional
--   <optgroup>s for selecting one option. Example usage:
--   
--   
--   areq (selectField $ optionsPairs [(MsgValue1, "value1"),(MsgValue2, "value2")]) "Which value?" Nothing
--   
selectField :: (Eq a, RenderMessage site FormMessage) => HandlerFor site (OptionList a) -> Field (HandlerFor site) a

-- | Creates a <select> tag for selecting one option.
--   Example usage:
--   
--   
--   areq (selectFieldList [("Value 1" :: Text, "value1"),("Value 2", "value2")]) "Which value?" Nothing
--   
selectFieldList :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg) => [(msg, a)] -> Field (HandlerFor site) a

-- | Creates a <select> tag with <optgroup>s
--   for selecting one option.
selectFieldListGrouped :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg) => [(msg, [(msg, a)])] -> Field (HandlerFor site) a

-- | Creates an input with type="radio" for selecting one option.

-- | Deprecated: This function seems to have a bug (label could not be
--   found with byLabel algorithm)
radioField :: (Eq a, RenderMessage site FormMessage) => HandlerFor site (OptionList a) -> Field (HandlerFor site) a

-- | Creates an input with type="radio" for selecting one option.
radioField' :: (Eq a, RenderMessage site FormMessage) => HandlerFor site (OptionList a) -> Field (HandlerFor site) a

-- | Creates an input with type="radio" for selecting one option.
radioFieldList :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg) => [(msg, a)] -> Field (HandlerFor site) a

-- | Allows the user to place the option radio widget somewhere in the
--   template. For example: If you want a table of radio options to select.
--   radioField is an example on how to use this function.
withRadioField :: (Eq a, RenderMessage site FormMessage) => (Text -> WidgetFor site () -> WidgetFor site ()) -> (Text -> Text -> Bool -> Text -> WidgetFor site () -> WidgetFor site ()) -> HandlerFor site (OptionList a) -> Field (HandlerFor site) a

-- | Creates an input with type="checkbox" for selecting multiple
--   options.

-- | Deprecated: This function seems to have a bug (label could not be
--   found with byLabel algorithm)
checkboxesField :: Eq a => HandlerFor site (OptionList a) -> Field (HandlerFor site) [a]

-- | Creates an input with type="checkbox" for selecting multiple
--   options.
checkboxesField' :: Eq a => HandlerFor site (OptionList a) -> Field (HandlerFor site) [a]

-- | Creates an input with type="checkbox" for selecting multiple
--   options.
checkboxesFieldList :: (Eq a, RenderMessage site msg) => [(msg, a)] -> Field (HandlerFor site) [a]

-- | Creates a <select> tag for selecting multiple options.
multiSelectField :: Eq a => HandlerFor site (OptionList a) -> Field (HandlerFor site) [a]

-- | Creates a <select> tag for selecting multiple options.
multiSelectFieldList :: (Eq a, RenderMessage site msg) => [(msg, a)] -> Field (HandlerFor site) [a]
data Option a
Option :: Text -> a -> Text -> Option a

-- | The user-facing label.
[optionDisplay] :: Option a -> Text

-- | The Haskell value being selected.
[optionInternalValue] :: Option a -> a

-- | The representation of this value stored in the form.
[optionExternalValue] :: Option a -> Text

-- | A structure holding a list of options. Typically you can use a
--   convenience function like mkOptionList or optionsPairs
--   instead of creating this directly.
--   
--   Extended by OptionListGrouped in 1.7.0.
data OptionList a
OptionList :: [Option a] -> (Text -> Maybe a) -> OptionList a
[olOptions] :: OptionList a -> [Option a]

-- | A function mapping from the form's value (optionExternalValue)
--   to the selected Haskell value (optionInternalValue).
[olReadExternal] :: OptionList a -> Text -> Maybe a
OptionListGrouped :: [(Text, [Option a])] -> (Text -> Maybe a) -> OptionList a
[olOptionsGrouped] :: OptionList a -> [(Text, [Option a])]

-- | A function mapping from the form's value (optionExternalValue)
--   to the selected Haskell value (optionInternalValue).
[olReadExternalGrouped] :: OptionList a -> Text -> Maybe a

-- | Creates an OptionList, using a Map to implement the
--   olReadExternal function.
mkOptionList :: [Option a] -> OptionList a

-- | Creates an OptionList, using a Map to implement the
--   olReadExternalGrouped function.
mkOptionListGrouped :: [(Text, [Option a])] -> OptionList a

-- | Selects a list of Entitys with the given Filter and
--   SelectOpts. The (a -> msg) function is then used to
--   derive the display value for an OptionList. Example usage:
--   
--   
--   Country
--      name Text
--      deriving Eq -- Must derive Eq
--   
--   
--   
--   data CountryForm = CountryForm
--     { country :: Entity Country
--     }
--   
--   countryNameForm :: AForm Handler CountryForm
--   countryNameForm = CountryForm
--           <$> areq (selectField countries) "Which country do you live in?" Nothing
--           where
--             countries = optionsPersist [] [Asc CountryName] countryName
--   
optionsPersist :: (YesodPersist site, PersistQueryRead backend, PathPiece (Key a), RenderMessage site msg, YesodPersistBackend site ~ backend, PersistRecordBackend a backend) => [Filter a] -> [SelectOpt a] -> (a -> msg) -> HandlerFor site (OptionList (Entity a))

-- | An alternative to optionsPersist which returns just the
--   Key instead of the entire Entity.
optionsPersistKey :: (YesodPersist site, PersistQueryRead backend, PathPiece (Key a), RenderMessage site msg, backend ~ YesodPersistBackend site, PersistRecordBackend a backend) => [Filter a] -> [SelectOpt a] -> (a -> msg) -> HandlerFor site (OptionList (Key a))

-- | Creates an OptionList from a list of (display-value, internal
--   value) pairs.
optionsPairs :: (MonadHandler m, RenderMessage (HandlerSite m) msg) => [(msg, a)] -> m (OptionList a)

-- | Creates an OptionList from a list of (display-value, internal
--   value) pairs.
optionsPairsGrouped :: (MonadHandler m, RenderMessage (HandlerSite m) msg) => [(msg, [(msg, a)])] -> m (OptionList a)

-- | Creates an OptionList from an Enum, using its
--   Show instance for the user-facing value.
optionsEnum :: (MonadHandler m, Show a, Enum a, Bounded a) => m (OptionList a)

-- | Creates an input with type="color". The input value must be
--   provided in hexadecimal format #rrggbb.
colorField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Text

-- | Creates an input with type="datetime-local". The input value
--   must be provided in YYYY-MM-DD(T| )HH:MM[:SS] format.
datetimeLocalField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m LocalTime
instance GHC.Classes.Eq Yesod.Form.Fields.Textarea
instance Data.Aeson.Types.FromJSON.FromJSON Yesod.Form.Fields.Textarea
instance GHC.Internal.Base.Functor Yesod.Form.Fields.Option
instance GHC.Internal.Base.Functor Yesod.Form.Fields.OptionList
instance GHC.Internal.Data.String.IsString Yesod.Form.Fields.Textarea
instance GHC.Classes.Ord Yesod.Form.Fields.Textarea
instance Database.Persist.Sql.Class.PersistFieldSql Yesod.Form.Fields.Textarea
instance Database.Persist.Class.PersistField.PersistField Yesod.Form.Fields.Textarea
instance GHC.Internal.Read.Read Yesod.Form.Fields.Textarea
instance GHC.Internal.Show.Show Yesod.Form.Fields.Textarea
instance Data.Aeson.Types.ToJSON.ToJSON Yesod.Form.Fields.Textarea
instance Text.Blaze.ToMarkup Yesod.Form.Fields.Textarea

module Yesod.Form.Option

-- | Creates an OptionList from a List, using the
--   PathPiece instance for the external value and a custom function
--   for the user-facing value.
--   
--   PathPiece instances should provide suitable external values, since
--   path pieces serve to be exposed through URLs or HTML anyway. Show/Read
--   instances are avoided here since they could leak internal
--   representations to forms, query params, javascript etc.
--   
--   
Example usage
--   
--   
--   data UserRole = URSalesTeam | URSalesHead | URTechTeam | URTechHead
--   
--   instance PathPiece UserDepartment where
--     toPathPiece = \case
--       URSalesTeam -> "sales-team"
--       URSalesHead -> "sales-head"
--       URTechTeam -> "tech-team"
--       URTechHead -> "tech-head"
--     fromPathPiece = \case
--       "sales-team" -> Just URSalesTeam
--       "sales-head" -> Just URSalesHead
--       "tech-team" -> Just URTechTeam
--       "tech-head" -> Just URTechHead
--       _ -> Nothing
--   
--   userRoleOptions ::
--     (MonadHandler m, RenderMessage (HandlerSite m) msg) => m (OptionList UserRole)
--   userRoleOptions = optionsFromList' userRoles toMsg
--     where
--     userRoles = [URSalesTeam, URSalesHead, URTechTeam, URTechHead]
--     toMsg :: UserRole -> Text
--     toMsg = \case
--       URSalesTeam -> "Sales Team"
--       URSalesHead -> "Head of Sales Team"
--       URTechTeam -> "Tech Team"
--       URTechHead -> "Head of Tech Team"
--   
--   
--   userRoleOptions, will produce an OptionList with the following
--   attributes:
--   
--   
--   +----------------+----------------+--------------------+
--   | Internal Value | External Value | User-facing Value  |
--   +----------------+----------------+--------------------+
--   | URSalesTeam    | sales-team     | Sales Team         |
--   +----------------+----------------+--------------------+
--   | URSalesHead    | sales-head     | Head of Sales Team |
--   +----------------+----------------+--------------------+
--   | URTechTeam     | tech-team      | Tech Team          |
--   +----------------+----------------+--------------------+
--   | URTechHead     | tech-head      | Head of Tech Team  |
--   +----------------+----------------+--------------------+
--   
--   
--   Note that the type constraint allows localizable messages in place of
--   toMsg (see
--   https://en.wikipedia.org/wiki/Yesod_(web_framework)#Localizable_messages).
optionsFromList' :: (MonadHandler m, RenderMessage (HandlerSite m) msg, PathPiece a) => [a] -> (a -> msg) -> m (OptionList a)

-- | Creates an OptionList from an Enum.
--   
--   optionsEnum' == optionsFromList' [minBound..maxBound]
--   
--   Creates an OptionList containing every constructor of
--   a, so that these constructors do not need to be typed out.
--   Bounded and Enum instances must exist for a to use this.
optionsEnum' :: (MonadHandler m, RenderMessage (HandlerSite m) msg, PathPiece a, Enum a, Bounded a) => (a -> msg) -> m (OptionList a)

-- | A module providing a means of creating multiple input forms, such as a
--   list of 0 or more recipients.
module Yesod.Form.MassInput

-- | Generate a form that accepts 0 or more values from the user, allowing
--   the user to specify that a new row is necessary.
inputList :: (xml ~ WidgetFor site (), RenderMessage site FormMessage) => Html -> ([[FieldView site]] -> xml) -> (Maybe a -> AForm (HandlerFor site) a) -> Maybe [a] -> AForm (HandlerFor site) [a]
massDivs :: [[FieldView site]] -> WidgetFor site ()
massTable :: [[FieldView site]] -> WidgetFor site ()

-- | Helper functions for creating forms when using Bootstrap 3.
module Yesod.Form.Bootstrap3

-- | Render the given form using Bootstrap v3 conventions.
--   
--   Since: yesod-form 1.3.8
renderBootstrap3 :: forall (m :: Type -> Type) a. Monad m => BootstrapFormLayout -> FormRender m a

-- | The layout used for the bootstrap form.
--   
--   Since: yesod-form 1.3.8
data BootstrapFormLayout

-- | A form with labels and inputs listed vertically. See
--   http://getbootstrap.com/css/#forms-example
BootstrapBasicForm :: BootstrapFormLayout

-- | A form whose <inputs> are laid out horizontally
--   (displayed as inline-block). For this layout,
--   <label>s are still added to the HTML, but are hidden
--   from display. When using this layout, you must add the
--   form-inline class to your form tag. See
--   http://getbootstrap.com/css/#forms-inline
BootstrapInlineForm :: BootstrapFormLayout
BootstrapHorizontalForm :: !BootstrapGridOptions -> !BootstrapGridOptions -> !BootstrapGridOptions -> !BootstrapGridOptions -> BootstrapFormLayout

-- | The left offset of the <label>.
[bflLabelOffset] :: BootstrapFormLayout -> !BootstrapGridOptions

-- | The number of grid columns the <label> should use.
[bflLabelSize] :: BootstrapFormLayout -> !BootstrapGridOptions

-- | The left offset of the <input> from its
--   <label>.
[bflInputOffset] :: BootstrapFormLayout -> !BootstrapGridOptions

-- | The number of grid columns the <input> should use.
[bflInputSize] :: BootstrapFormLayout -> !BootstrapGridOptions

-- | How many bootstrap grid columns should be taken (see
--   BootstrapFormLayout).
--   
--   Since: yesod-form 1.3.8
data BootstrapGridOptions
ColXs :: !Int -> BootstrapGridOptions
ColSm :: !Int -> BootstrapGridOptions
ColMd :: !Int -> BootstrapGridOptions
ColLg :: !Int -> BootstrapGridOptions

-- | Create a new FieldSettings with the form-control class
--   that is required by Bootstrap v3.
--   
--   Since: yesod-form 1.3.8
bfs :: RenderMessage site msg => msg -> FieldSettings site

-- | Add a placeholder attribute to a field. If you need i18n for the
--   placeholder, currently you'll need to do a hack and use
--   getMessageRender manually.
--   
--   Since: yesod-form 1.3.8
withPlaceholder :: Text -> FieldSettings site -> FieldSettings site

-- | Add an autofocus attribute to a field.
--   
--   Since: yesod-form 1.3.8
withAutofocus :: FieldSettings site -> FieldSettings site

-- | Add the input-lg CSS class to a field.
--   
--   Since: yesod-form 1.3.8
withLargeInput :: FieldSettings site -> FieldSettings site

-- | Add the input-sm CSS class to a field.
--   
--   Since: yesod-form 1.3.8
withSmallInput :: FieldSettings site -> FieldSettings site

-- | A Bootstrap v3 submit button disguised as a field for convenience. For
--   example, if your form currently is:
--   
--   
--   Person <$> areq textField "Name"    Nothing
--          <*> areq textField "Surname" Nothing
--   
--   
--   Then just change it to:
--   
--   
--   Person <$> areq textField "Name"    Nothing
--          <*> areq textField "Surname" Nothing
--          <*  bootstrapSubmit ("Register" :: BootstrapSubmit Text)
--   
--   
--   (Note that <* is not a typo.)
--   
--   Alternatively, you may also just create the submit button manually as
--   well in order to have more control over its layout.
--   
--   Since: yesod-form 1.3.8
bootstrapSubmit :: forall site msg (m :: Type -> Type). (RenderMessage site msg, HandlerSite m ~ site, MonadHandler m) => BootstrapSubmit msg -> AForm m ()

-- | Same as bootstrapSubmit but for monadic forms. This isn't as
--   useful since you're not going to use renderBootstrap3 anyway.
--   
--   Since: yesod-form 1.3.8
mbootstrapSubmit :: forall site msg (m :: Type -> Type). (RenderMessage site msg, HandlerSite m ~ site, MonadHandler m) => BootstrapSubmit msg -> MForm m (FormResult (), FieldView site)

-- | How the bootstrapSubmit button should be rendered.
--   
--   Since: yesod-form 1.3.8
data BootstrapSubmit msg
BootstrapSubmit :: msg -> Text -> [(Text, Text)] -> BootstrapSubmit msg

-- | The text of the submit button.
[bsValue] :: BootstrapSubmit msg -> msg

-- | Classes added to the <button>.
[bsClasses] :: BootstrapSubmit msg -> Text

-- | Attributes added to the <button>.
[bsAttrs] :: BootstrapSubmit msg -> [(Text, Text)]
instance GHC.Classes.Eq Yesod.Form.Bootstrap3.BootstrapGridOptions
instance GHC.Internal.Data.String.IsString msg => GHC.Internal.Data.String.IsString (Yesod.Form.Bootstrap3.BootstrapSubmit msg)
instance GHC.Classes.Ord Yesod.Form.Bootstrap3.BootstrapGridOptions
instance GHC.Internal.Show.Show Yesod.Form.Bootstrap3.BootstrapFormLayout
instance GHC.Internal.Show.Show Yesod.Form.Bootstrap3.BootstrapGridOptions
instance GHC.Internal.Show.Show msg => GHC.Internal.Show.Show (Yesod.Form.Bootstrap3.BootstrapSubmit msg)

-- | Parse forms (and query strings).
module Yesod.Form
data Option a
Option :: Text -> a -> Text -> Option a

-- | The user-facing label.
[optionDisplay] :: Option a -> Text

-- | The Haskell value being selected.
[optionInternalValue] :: Option a -> a

-- | The representation of this value stored in the form.
[optionExternalValue] :: Option a -> Text
defaultFormMessage :: FormMessage -> Text

-- | Creates a input with type="text".
textField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Text

-- | Creates an input with type="password".
passwordField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Text

-- | Creates a <textarea> tag whose returned value is
--   wrapped in a Textarea; see Textarea for details.
textareaField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Textarea

-- | Creates an input with type="hidden"; you can use this to
--   store information in a form that users shouldn't see (for example,
--   Yesod stores CSRF tokens in a hidden field).
hiddenField :: forall (m :: Type -> Type) p. (Monad m, PathPiece p, RenderMessage (HandlerSite m) FormMessage) => Field m p

-- | Creates a input with type="number" and step=1.
intField :: forall (m :: Type -> Type) i. (Monad m, Integral i, RenderMessage (HandlerSite m) FormMessage) => Field m i

-- | Creates an input with type="date", validating the input using
--   the parseDate function.
--   
--   Add the time package and import the Data.Time.Calendar
--   module to use this function.
dayField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Day

-- | An alias for timeFieldTypeTime.
timeField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m TimeOfDay

-- | Creates an input with type="time". Browsers not supporting
--   this type will fallback to a text field, and Yesod will parse the
--   time as described in timeFieldTypeText.
--   
--   Add the time package and import the
--   Data.Time.LocalTime module to use this function.
timeFieldTypeTime :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m TimeOfDay

-- | Creates an input with type="text", parsing the time from an
--   [H]H:MM[:SS] format, with an optional AM or PM (if not given, AM is
--   assumed for compatibility with the 24 hour clock system).
--   
--   This function exists for backwards compatibility with the old
--   implementation of timeField, which used to use
--   type="text". Consider using timeField or
--   timeFieldTypeTime for improved UX and validation from the
--   browser.
--   
--   Add the time package and import the
--   Data.Time.LocalTime module to use this function.
timeFieldTypeText :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m TimeOfDay

-- | Creates a <textarea> tag whose input is sanitized to
--   prevent XSS attacks and is validated for having balanced tags.
htmlField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Html

-- | Creates an input with type="email". Yesod will validate the
--   email's correctness according to RFC5322 and canonicalize it by
--   removing comments and whitespace (see Text.Email.Validate).
emailField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Text

-- | Creates an input with type="email" with the multiple
--   attribute; browsers might implement this as taking a comma separated
--   list of emails. Each email address is validated as described in
--   emailField.
multiEmailField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m [Text]

-- | Creates an input with type="search". For browsers without
--   autofocus support, a JS fallback is used if AutoFocus is
--   true.
searchField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => AutoFocus -> Field m Text
type AutoFocus = Bool

-- | Creates an input with type="url", validating the URL
--   according to RFC3986.
urlField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Text

-- | Creates a input with type="number" and step=any.
doubleField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Double

-- | Parses a Day from a String.
parseDate :: String -> Either FormMessage Day
parseTime :: Text -> Either FormMessage TimeOfDay

-- | A newtype wrapper around a Text whose ToMarkup instance
--   converts newlines to HTML <br> tags.
--   
--   (When text is entered into a <textarea>, newline
--   characters are used to separate lines. If this text is then placed
--   verbatim into HTML, the lines won't be separated, thus the need for
--   replacing with <br> tags). If you don't need this
--   functionality, simply use unTextarea to access the raw text.
newtype Textarea
Textarea :: Text -> Textarea
[unTextarea] :: Textarea -> Text

-- | Creates a group of radio buttons to answer the question given in the
--   message. Radio buttons are used to allow differentiating between an
--   empty response (Nothing) and a no response (Just
--   False). Consider using the simpler checkBoxField if you
--   don't need to make this distinction.
--   
--   If this field is optional, the first radio button is labeled
--   "<None>", the second "Yes" and the third "No".
--   
--   If this field is required, the first radio button is labeled "Yes" and
--   the second "No".
--   
--   (Exact label titles will depend on localization).
boolField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Bool

-- | Creates an input with type="checkbox". While the default
--   boolField implements a radio button so you can
--   differentiate between an empty response (Nothing) and a no
--   response (Just False), this simpler checkbox field returns an
--   empty response as Just False.
--   
--   Note that this makes the field always optional.
checkBoxField :: forall (m :: Type -> Type). Monad m => Field m Bool

-- | Creates an input with type="file".
fileField :: forall (m :: Type -> Type). Monad m => Field m FileInfo
fileAFormReq :: forall (m :: Type -> Type). (MonadHandler m, RenderMessage (HandlerSite m) FormMessage) => FieldSettings (HandlerSite m) -> AForm m FileInfo
fileAFormOpt :: forall (m :: Type -> Type). MonadHandler m => FieldSettings (HandlerSite m) -> AForm m (Maybe FileInfo)

-- | A helper function for constucting selectFields with optional
--   option groups. You may want to use this when you define your custom
--   selectFields or radioFields.
selectFieldHelper :: (Eq a, RenderMessage site FormMessage) => (Text -> Text -> [(Text, Text)] -> WidgetFor site () -> WidgetFor site ()) -> (Text -> Text -> Bool -> WidgetFor site ()) -> (Text -> Text -> [(Text, Text)] -> Text -> Bool -> Text -> WidgetFor site ()) -> Maybe (Text -> WidgetFor site ()) -> HandlerFor site (OptionList a) -> Field (HandlerFor site) a

-- | Creates a <select> tag with optional
--   <optgroup>s for selecting one option. Example usage:
--   
--   
--   areq (selectField $ optionsPairs [(MsgValue1, "value1"),(MsgValue2, "value2")]) "Which value?" Nothing
--   
selectField :: (Eq a, RenderMessage site FormMessage) => HandlerFor site (OptionList a) -> Field (HandlerFor site) a

-- | Creates a <select> tag for selecting one option.
--   Example usage:
--   
--   
--   areq (selectFieldList [("Value 1" :: Text, "value1"),("Value 2", "value2")]) "Which value?" Nothing
--   
selectFieldList :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg) => [(msg, a)] -> Field (HandlerFor site) a

-- | Creates a <select> tag with <optgroup>s
--   for selecting one option.
selectFieldListGrouped :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg) => [(msg, [(msg, a)])] -> Field (HandlerFor site) a

-- | Creates an input with type="radio" for selecting one option.

-- | Deprecated: This function seems to have a bug (label could not be
--   found with byLabel algorithm)
radioField :: (Eq a, RenderMessage site FormMessage) => HandlerFor site (OptionList a) -> Field (HandlerFor site) a

-- | Creates an input with type="radio" for selecting one option.
radioField' :: (Eq a, RenderMessage site FormMessage) => HandlerFor site (OptionList a) -> Field (HandlerFor site) a

-- | Creates an input with type="radio" for selecting one option.
radioFieldList :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg) => [(msg, a)] -> Field (HandlerFor site) a

-- | Allows the user to place the option radio widget somewhere in the
--   template. For example: If you want a table of radio options to select.
--   radioField is an example on how to use this function.
withRadioField :: (Eq a, RenderMessage site FormMessage) => (Text -> WidgetFor site () -> WidgetFor site ()) -> (Text -> Text -> Bool -> Text -> WidgetFor site () -> WidgetFor site ()) -> HandlerFor site (OptionList a) -> Field (HandlerFor site) a

-- | Creates an input with type="checkbox" for selecting multiple
--   options.

-- | Deprecated: This function seems to have a bug (label could not be
--   found with byLabel algorithm)
checkboxesField :: Eq a => HandlerFor site (OptionList a) -> Field (HandlerFor site) [a]

-- | Creates an input with type="checkbox" for selecting multiple
--   options.
checkboxesField' :: Eq a => HandlerFor site (OptionList a) -> Field (HandlerFor site) [a]

-- | Creates an input with type="checkbox" for selecting multiple
--   options.
checkboxesFieldList :: (Eq a, RenderMessage site msg) => [(msg, a)] -> Field (HandlerFor site) [a]

-- | Creates a <select> tag for selecting multiple options.
multiSelectField :: Eq a => HandlerFor site (OptionList a) -> Field (HandlerFor site) [a]

-- | Creates a <select> tag for selecting multiple options.
multiSelectFieldList :: (Eq a, RenderMessage site msg) => [(msg, a)] -> Field (HandlerFor site) [a]

-- | A structure holding a list of options. Typically you can use a
--   convenience function like mkOptionList or optionsPairs
--   instead of creating this directly.
--   
--   Extended by OptionListGrouped in 1.7.0.
data OptionList a
OptionList :: [Option a] -> (Text -> Maybe a) -> OptionList a
[olOptions] :: OptionList a -> [Option a]

-- | A function mapping from the form's value (optionExternalValue)
--   to the selected Haskell value (optionInternalValue).
[olReadExternal] :: OptionList a -> Text -> Maybe a
OptionListGrouped :: [(Text, [Option a])] -> (Text -> Maybe a) -> OptionList a
[olOptionsGrouped] :: OptionList a -> [(Text, [Option a])]

-- | A function mapping from the form's value (optionExternalValue)
--   to the selected Haskell value (optionInternalValue).
[olReadExternalGrouped] :: OptionList a -> Text -> Maybe a

-- | Creates an OptionList, using a Map to implement the
--   olReadExternal function.
mkOptionList :: [Option a] -> OptionList a

-- | Creates an OptionList, using a Map to implement the
--   olReadExternalGrouped function.
mkOptionListGrouped :: [(Text, [Option a])] -> OptionList a

-- | Selects a list of Entitys with the given Filter and
--   SelectOpts. The (a -> msg) function is then used to
--   derive the display value for an OptionList. Example usage:
--   
--   
--   Country
--      name Text
--      deriving Eq -- Must derive Eq
--   
--   
--   
--   data CountryForm = CountryForm
--     { country :: Entity Country
--     }
--   
--   countryNameForm :: AForm Handler CountryForm
--   countryNameForm = CountryForm
--           <$> areq (selectField countries) "Which country do you live in?" Nothing
--           where
--             countries = optionsPersist [] [Asc CountryName] countryName
--   
optionsPersist :: (YesodPersist site, PersistQueryRead backend, PathPiece (Key a), RenderMessage site msg, YesodPersistBackend site ~ backend, PersistRecordBackend a backend) => [Filter a] -> [SelectOpt a] -> (a -> msg) -> HandlerFor site (OptionList (Entity a))

-- | An alternative to optionsPersist which returns just the
--   Key instead of the entire Entity.
optionsPersistKey :: (YesodPersist site, PersistQueryRead backend, PathPiece (Key a), RenderMessage site msg, backend ~ YesodPersistBackend site, PersistRecordBackend a backend) => [Filter a] -> [SelectOpt a] -> (a -> msg) -> HandlerFor site (OptionList (Key a))

-- | Creates an OptionList from a list of (display-value, internal
--   value) pairs.
optionsPairs :: (MonadHandler m, RenderMessage (HandlerSite m) msg) => [(msg, a)] -> m (OptionList a)

-- | Creates an OptionList from a list of (display-value, internal
--   value) pairs.
optionsPairsGrouped :: (MonadHandler m, RenderMessage (HandlerSite m) msg) => [(msg, [(msg, a)])] -> m (OptionList a)

-- | Creates an OptionList from an Enum, using its
--   Show instance for the user-facing value.
optionsEnum :: (MonadHandler m, Show a, Enum a, Bounded a) => m (OptionList a)

-- | Creates an input with type="color". The input value must be
--   provided in hexadecimal format #rrggbb.
colorField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Text

-- | Creates an input with type="datetime-local". The input value
--   must be provided in YYYY-MM-DD(T| )HH:MM[:SS] format.
datetimeLocalField :: forall (m :: Type -> Type). (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m LocalTime

-- | Provide the user with a rich text editor.
--   
--   According to NIC editor homepage it is not actively maintained since
--   June 2012. There is another better alternative — open sourced
--   Summernote editor released under MIT licence. You can use Summernote
--   in your Yesod forms via separately distributed
--   yesod-form-richtext package.
module Yesod.Form.Nic
class Yesod a => YesodNic a

-- | NIC Editor Javascript file.
urlNicEdit :: YesodNic a => a -> Either (Route a) Text
nicHtmlField :: YesodNic site => Field (HandlerFor site) Html

-- | Some fields spiced up with jQuery UI.
module Yesod.Form.Jquery
class YesodJquery a

-- | The jQuery Javascript file. Note that in upgrades to this library, the
--   version of jQuery referenced, or where it is downloaded from, may be
--   changed without warning. If you are relying on a specific version of
--   jQuery, you should give an explicit URL instead of relying on the
--   default value.
--   
--   Currently, the default value is jQuery 1.7 from Google's CDN.
urlJqueryJs :: YesodJquery a => a -> Either (Route a) Text

-- | The jQuery UI 1.8 Javascript file.
urlJqueryUiJs :: YesodJquery a => a -> Either (Route a) Text

-- | The jQuery UI 1.8 CSS file; defaults to cupertino theme.
urlJqueryUiCss :: YesodJquery a => a -> Either (Route a) Text

-- | jQuery UI time picker add-on.
urlJqueryUiDateTimePicker :: YesodJquery a => a -> Either (Route a) Text
jqueryDayField :: (RenderMessage site FormMessage, YesodJquery site) => JqueryDaySettings -> Field (HandlerFor site) Day

-- | Use jQuery's datepicker as the underlying implementation.
--   
--   Since 1.4.3
jqueryDatePickerDayField :: (RenderMessage site FormMessage, YesodJquery site) => JqueryDaySettings -> Field (HandlerFor site) Day
jqueryAutocompleteField :: (RenderMessage site FormMessage, YesodJquery site) => Route site -> Field (HandlerFor site) Text
jqueryAutocompleteField' :: (RenderMessage site FormMessage, YesodJquery site) => Int -> Route site -> Field (HandlerFor site) Text

-- | Gets the Google hosted jQuery UI 1.8 CSS file with the given theme.
googleHostedJqueryUiCss :: Text -> Text
data JqueryDaySettings
JqueryDaySettings :: Bool -> Bool -> String -> Either Int (Int, Int) -> JqueryDaySettings
[jdsChangeMonth] :: JqueryDaySettings -> Bool
[jdsChangeYear] :: JqueryDaySettings -> Bool
[jdsYearRange] :: JqueryDaySettings -> String
[jdsNumberOfMonths] :: JqueryDaySettings -> Either Int (Int, Int)

-- | A class for types with a default value.
class Default a

-- | The default value for this type.
def :: Default a => a
($dmdef) :: (Default a, Generic a, GDefault (Rep a)) => a
instance Data.Default.Internal.Default Yesod.Form.Jquery.JqueryDaySettings
