scotty-form-0.4.1.0: Html form validation using `ditto`
Safe HaskellNone
LanguageHaskell2010

Web.Scotty.Form

Synopsis

Documentation

data ScottyFormError Source #

the error case of running a ScottyForm

Instances

Instances details
ToHtml ScottyFormError Source # 
Instance details

Defined in Web.Scotty.Trans.Form

Methods

toHtml :: forall (m :: Type -> Type). Monad m => ScottyFormError -> HtmlT m () #

toHtmlRaw :: forall (m :: Type -> Type). Monad m => ScottyFormError -> HtmlT m () #

FormError [Param] ScottyFormError Source # 
Instance details

Defined in Web.Scotty.Trans.Form

encQP :: [(a, Text)] -> Text Source #

type ScottyForm a = Form ActionM [Param] ScottyFormError (Html ()) a Source #

a ditto formlet for scotty

ditto Source #

Arguments

:: Monoid view 
=> ([(Text, Text)] -> view -> view)

wrap raw form html inside a form tag

-> Text

form name prefix

-> Form ActionM [Param] err view a

the formlet

-> ActionM (Result err a, view) 

dittoSingle Source #

Arguments

:: ([(Text, Text)] -> view -> view)

wrap raw form html inside a form tag

-> Text

form name prefix

-> Form ActionM [Param] err view a

the formlet

-> ActionM (Result err a, view) 

a helpful wrapper around runForm

simpleDittoGET Source #

Arguments

:: Applicative f 
=> Text

action

-> Form ActionM [Param] err (HtmlT f ()) b

formlet

-> ActionM (Result err b, HtmlT f ()) 

create <form action=action method="GET" enctype="application/xxx-form-urlencoded">

simpleDittoPOST Source #

Arguments

:: Applicative f 
=> Text

action

-> Form ActionM [Param] err (HtmlT f ()) b

formlet

-> ActionM (Result err b, HtmlT f ()) 

create <form action=action method="POST" enctype="application/xxx-form-urlencoded">

liftParser' :: (Text -> Either Text a) -> [Param] -> Either ScottyFormError a Source #

lift a function which parses strict Text into a function which parses a [Param]

liftParser :: (Text -> Either Text a) -> [Param] -> Either ScottyFormError a Source #

lift a function which parses lazy Text into a function which parses a [Param] e.g.

parserRead :: Read a => [Param] -> Either ScottyFormError a
parserRead = liftParser readEither