-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Formlets implemented in Haskell
--
-- A modular way to build forms based on applicative functors, as
-- described in:
--
--
@package formlets
@version 0.2.1
module Text.Formlets
-- | Helper function for genereting input components based forms.
input' :: (String -> String -> xml) -> Maybe String -> Form xml String
fmapFst :: (t -> t2) -> (t, t1) -> (t2, t1)
-- | Add additional validation to an already validated component
check :: Form xml a -> (a -> Failing b) -> Form xml b
-- | Apply a predicate to a value and return Success or Failure as
-- appropriate
ensure :: (Show a) => (a -> Bool) -> String -> a -> Failing a
-- | Apply multiple predicates to a value, return Success or all the
-- Failure messages
ensures :: (Show a) => [(a -> Bool, String)] -> a -> Failing a
-- | Runs the form state
runFormState :: Env -> Form xml a -> (Collector (Failing a), xml)
-- | Component: just some xml
xml :: xml -> Form xml ()
-- | Transform the XML component
plug :: (Plus xml) => (xml -> xml) -> Form xml a -> Form xml a
type Env = [(String, String)]
data Form xml a
class Plus a
zero :: (Plus a) => a
plus :: (Plus a) => a -> a -> a
instance (Plus xml) => Applicative (Form xml)
instance Functor (Form xml)
module Text.XHtml.Strict.Formlets
-- | An input field with an optional value
input :: Maybe String -> XHtmlForm String
textarea :: Maybe String -> XHtmlForm String
-- | A password field with an optional value
password :: Maybe String -> XHtmlForm String
-- | A hidden input field
hidden :: Maybe String -> XHtmlForm String
-- | A validated integer component
inputInteger :: Maybe Integer -> XHtmlForm Integer
-- | A radio choice
radio :: [(String, String)] -> Maybe String -> XHtmlForm String
enumRadio :: (Enum a) => [(a, String)] -> Maybe a -> XHtmlForm a
type XHtmlForm a = Form Html a
instance Plus Html