formlets-0.2.1: Formlets implemented in Haskell

Text.Formlets

Synopsis

Documentation

input' :: (String -> String -> xml) -> Maybe String -> Form xml StringSource

Helper function for genereting input components based forms.

fmapFst :: (t -> t2) -> (t, t1) -> (t2, t1)Source

check :: Form xml a -> (a -> Failing b) -> Form xml bSource

Add additional validation to an already validated component

ensureSource

Arguments

:: Show a 
=> (a -> Bool)

The predicate

-> String

The error message, in case the predicate fails

-> a

The value

-> Failing a 

Apply a predicate to a value and return Success or Failure as appropriate

ensuresSource

Arguments

:: Show a 
=> [(a -> Bool, String)]

List of predicate functions and error messages, in case the predicate fails

-> a

The value

-> Failing a 

Apply multiple predicates to a value, return Success or all the Failure messages

runFormStateSource

Arguments

:: Env

A previously filled environment (may be empty)

-> Form xml a

The form

-> (Collector (Failing a), xml) 

Runs the form state

xml :: xml -> Form xml ()Source

Component: just some xml

plug :: Plus xml => (xml -> xml) -> Form xml a -> Form xml aSource

Transform the XML component

type Env = [(String, String)]Source

data Form xml a Source

Instances

Functor (Form xml) 
Plus xml => Applicative (Form xml) 

class Plus a whereSource

Methods

zero :: aSource

plus :: a -> a -> aSource

Instances