module Web.Scotty.Form
( Trans.ScottyFormError(..)
, encQP
, ScottyForm
, ditto
, dittoSingle
, simpleDittoGET
, simpleDittoPOST
, liftParser'
, liftParser
) where
import Data.Text (Text)
import Ditto.Core hiding (view)
import Ditto.Types
import Web.Scotty
import qualified Web.Scotty.Trans.Form as Trans
import qualified Data.Text.Lazy as TL
import Lucid
encQP :: [(a, TL.Text)] -> Text
encQP :: [(a, Text)] -> Text
encQP = [(a, Text)] -> Text
forall a. [(a, Text)] -> Text
Trans.encQP
type ScottyForm a = Form ActionM [Param] Trans.ScottyFormError (Html ()) a
ditto :: (Monoid view)
=> ([(Text, Text)] -> view -> view)
-> Text
-> Form ActionM [Param] err view a
-> ActionM (Result err a, view)
ditto :: ([(Text, Text)] -> view -> view)
-> Text
-> Form ActionM [Param] err view a
-> ActionM (Result err a, view)
ditto = ([(Text, Text)] -> view -> view)
-> Text
-> Form ActionM [Param] err view a
-> ActionM (Result err a, view)
forall view (m :: * -> *) e err a.
(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)
Trans.ditto
dittoSingle
:: ([(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)
dittoSingle = ([(Text, Text)] -> view -> view)
-> Text
-> Form ActionM [Param] err view a
-> ActionM (Result err a, view)
forall (m :: * -> *) e view err a.
(Monad m, ScottyError e) =>
([(Text, Text)] -> view -> view)
-> Text
-> Form (ActionT e m) [Param] err view a
-> ActionT e m (Result err a, view)
Trans.dittoSingle
simpleDittoGET :: (Applicative f)
=> Text
-> Form ActionM [Param] err (HtmlT f ()) b
-> ActionM (Result err b, HtmlT f ())
simpleDittoGET :: Text
-> Form ActionM [Param] err (HtmlT f ()) b
-> ActionM (Result err b, HtmlT f ())
simpleDittoGET = Text
-> Form ActionM [Param] err (HtmlT f ()) b
-> ActionM (Result err b, HtmlT f ())
forall (f :: * -> *) (m :: * -> *) e err b.
(Applicative f, Monad m, ScottyError e) =>
Text
-> Form (ActionT e m) [Param] err (HtmlT f ()) b
-> ActionT e m (Result err b, HtmlT f ())
Trans.simpleDittoGET
simpleDittoPOST :: (Applicative f)
=> Text
-> Form ActionM [Param] err (HtmlT f ()) b
-> ActionM (Result err b, HtmlT f ())
simpleDittoPOST :: Text
-> Form ActionM [Param] err (HtmlT f ()) b
-> ActionM (Result err b, HtmlT f ())
simpleDittoPOST = Text
-> Form ActionM [Param] err (HtmlT f ()) b
-> ActionM (Result err b, HtmlT f ())
forall (f :: * -> *) (m :: * -> *) e err b.
(Applicative f, Monad m, ScottyError e) =>
Text
-> Form (ActionT e m) [Param] err (HtmlT f ()) b
-> ActionT e m (Result err b, HtmlT f ())
Trans.simpleDittoPOST
liftParser' :: (Text -> Either Text a) -> ([Param] -> Either Trans.ScottyFormError a)
liftParser' :: (Text -> Either Text a) -> [Param] -> Either ScottyFormError a
liftParser' = (Text -> Either Text a) -> [Param] -> Either ScottyFormError a
forall a.
(Text -> Either Text a) -> [Param] -> Either ScottyFormError a
Trans.liftParser'
liftParser :: (TL.Text -> Either TL.Text a) -> ([Param] -> Either Trans.ScottyFormError a)
liftParser :: (Text -> Either Text a) -> [Param] -> Either ScottyFormError a
liftParser = (Text -> Either Text a) -> [Param] -> Either ScottyFormError a
forall a.
(Text -> Either Text a) -> [Param] -> Either ScottyFormError a
Trans.liftParser