Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data ScottyFormError
- encQP :: [(a, Text)] -> Text
- type ScottyForm a = Form ActionM [Param] ScottyFormError (Html ()) a
- ditto :: Monoid view => ([(Text, Text)] -> view -> view) -> Text -> Form ActionM [Param] err view a -> ActionM (Result err a, view)
- dittoSingle :: ([(Text, Text)] -> view -> view) -> Text -> Form ActionM [Param] err view a -> ActionM (Result err a, view)
- simpleDittoGET :: Applicative f => Text -> Form ActionM [Param] err (HtmlT f ()) b -> ActionM (Result err b, HtmlT f ())
- simpleDittoPOST :: Applicative f => Text -> Form ActionM [Param] err (HtmlT f ()) b -> ActionM (Result err b, HtmlT f ())
- liftParser' :: (Text -> Either Text a) -> [Param] -> Either ScottyFormError a
- liftParser :: (Text -> Either Text a) -> [Param] -> Either ScottyFormError a
Documentation
data ScottyFormError Source #
the error case of running a ScottyForm
Instances
ToHtml ScottyFormError Source # | |
Defined in Web.Scotty.Trans.Form | |
FormError [Param] ScottyFormError Source # | |
Defined in Web.Scotty.Trans.Form |
type ScottyForm a = Form ActionM [Param] ScottyFormError (Html ()) a Source #
a ditto
formlet for scotty
:: ([(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
:: 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">
:: 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