Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data ScottyFormError
- encQP :: [(a, Text)] -> Text
- type ScottyForm e m a = Form (ActionT e m) [Param] ScottyFormError (HtmlT (ActionT e m) ()) a
- ditto :: (Monoid view, Monad m, ScottyError e) => ([(Text, Text)] -> view -> view) -> Text -> Form (ActionT e m) [Param] err view a -> ActionT e m (Result err a, view)
- dittoSingle :: (Monad m, ScottyError e) => ([(Text, Text)] -> view -> view) -> Text -> Form (ActionT e m) [Param] err view a -> ActionT e m (Result err a, view)
- simpleDittoGET :: (Applicative f, Monad m, ScottyError e) => Text -> Form (ActionT e m) [Param] err (HtmlT f ()) b -> ActionT e m (Result err b, HtmlT f ())
- simpleDittoPOST :: (Applicative f, Monad m, ScottyError e) => Text -> Form (ActionT e m) [Param] err (HtmlT f ()) b -> ActionT e m (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 e m a = Form (ActionT e m) [Param] ScottyFormError (HtmlT (ActionT e m) ()) a Source #
a ditto
formlet for scotty
:: (Monad m, ScottyError e) | |
=> ([(Text, Text)] -> view -> view) | wrap raw form html inside a form tag |
-> Text | form name prefix |
-> Form (ActionT e m) [Param] err view a | the formlet |
-> ActionT e m (Result err a, view) |
a helpful wrapper around runForm
:: (Applicative f, Monad m, ScottyError e) | |
=> Text | action |
-> Form (ActionT e m) [Param] err (HtmlT f ()) b | formlet |
-> ActionT e m (Result err b, HtmlT f ()) |
create <form action=action method="GET" enctype="application/xxx-form-urlencoded">
:: (Applicative f, Monad m, ScottyError e) | |
=> Text | action |
-> Form (ActionT e m) [Param] err (HtmlT f ()) b | formlet |
-> ActionT e m (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
Orphan instances
FormInput [Param] Source # | |
getInputString :: FormError [Param] err => [Param] -> Either err String # getInputStrings :: [Param] -> [String] # getInputText :: FormError [Param] err => [Param] -> Either err Text # getInputTexts :: [Param] -> [Text] # getInputFile :: FormError [Param] err => [Param] -> Either err (FileType [Param]) # | |
(ScottyError e, Monad m) => Environment (ActionT e m) [Param] Source # | |