yesod-form-1.2.1: Form handling support for Yesod Web Framework

Safe HaskellNone

Yesod.Form.Types

Contents

Synopsis

Helpers

data Enctype Source

The encoding type required by a form. The ToHtml instance produces values that can be inserted directly into HTML.

Constructors

UrlEncoded 
Multipart 

data FormResult a Source

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.

data Ints Source

Constructors

IntCons Int Ints 
IntSingle Int 

Instances

Form

type MForm sub master a = RWST (Maybe (Env, FileEnv), master, [Lang]) Enctype Ints (GHandler sub master) aSource

newtype AForm sub master a Source

Constructors

AForm 

Fields

unAForm :: (master, [Text]) -> Maybe (Env, FileEnv) -> Ints -> GHandler sub master (FormResult a, [FieldView sub master] -> [FieldView sub master], Ints, Enctype)
 

Instances

Functor (AForm sub master) 
Functor (AForm sub master) => Applicative (AForm sub master) 
MonadLift (GHandler sub master) (AForm sub master) 
Monoid a => Monoid (AForm sub master a) 

Build forms

data Field sub master a Source

Constructors

Field 

Fields

fieldParse :: [Text] -> [FileInfo] -> GHandler sub master (Either (SomeMessage master) (Maybe a))
 
fieldView :: FieldViewFunc sub master a
 
fieldEnctype :: Enctype
 

data FieldSettings master Source

Constructors

FieldSettings 

Fields

fsLabel :: SomeMessage master
 
fsTooltip :: Maybe (SomeMessage master)
 
fsId :: Maybe Text
 
fsName :: Maybe Text
 
fsAttrs :: [(Text, Text)]
 

Instances

data FieldView sub master Source

Constructors

FieldView 

type FieldViewFunc sub master aSource

Arguments

 = Text

ID

-> Text

Name

-> [(Text, Text)]

Attributes

-> Either Text a

Either (invalid text) or (legitimate result)

-> Bool

Required?

-> GWidget sub master ()