formlets-0.4.1: Formlets implemented in Haskell

Text.Formlets

Synopsis

Documentation

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

Helper function for genereting input components based forms.

inputFile :: Monad m => (String -> xml) -> Form xml m FileSource

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

check :: Monad m => Form xml m a -> (a -> Failing b) -> Form xml m 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

ensureMSource

Arguments

:: (Monad m, Show a) 
=> (a -> m Bool)

The predicate

-> String

The error message, in case the predicate fails

-> a

The value

-> m (Failing a) 

checkM :: Monad m => Form xml m a -> (a -> m (Failing b)) -> Form xml m bSource

Add additional validation to an already validated component

pureM :: (Monad m, Plus xml) => m a -> Form xml m aSource

runFormStateSource

Arguments

:: Monad m 
=> Env

A previously filled environment (may be empty)

-> Form xml m a

The form

-> (Collector (m (Failing a)), xml, FormContentType) 

Runs the form state

xml :: Monad m => xml -> Form xml m ()Source

Component: just some xml

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

Transform the XML component

data Form xml m a Source

Instances

(Functor m, Monad m) => Functor (Form xml m) 
(Monad m, Applicative m, Plus xml) => Applicative (Form xml m) 

class Plus a whereSource

Methods

zero :: aSource

plus :: a -> a -> aSource

Instances

data File Source

Constructors

File 

Instances