digestive-functors-0.7.1.5: A practical formlet library

Safe HaskellSafe-Inferred
LanguageHaskell98

Text.Digestive.Form.Internal.Field

Description

Internal embedding of form fields with associated functions.

Synopsis

Documentation

data Field v a where Source

A single input field. This usually maps to a single HTML input element.

Constructors

Singleton :: a -> Field v a 
Text :: Text -> Field v Text 
Choice :: [(Text, [(Text, (a, v))])] -> Int -> Field v (a, Int) 
Bool :: Bool -> Field v Bool 
File :: Field v (Maybe FilePath) 

Instances

Show (Field v a) 

data SomeField v Source

Value agnostic Field

Constructors

forall a . SomeField (Field v a) 

evalField Source

Arguments

:: Method

Get/Post

-> [FormInput]

Given input

-> Field v a

Field

-> a

Result

Evaluate a field to retrieve a value, using the given method and a list of input.

fieldMapView :: (v -> w) -> Field v a -> Field w a Source

Map on the error message type of a Field.