Safe Haskell | None |
---|
- data Options = Options {}
- type Middleware m = Application m -> Application m
- type Application m = Request -> m Response
- data ScottyState e m = ScottyState {
- middlewares :: [Middleware]
- routes :: [Middleware m]
- handler :: ErrorHandler e m
- addMiddleware :: Middleware -> ScottyState e m -> ScottyState e m
- addRoute :: Monad m => Middleware m -> ScottyState e m -> ScottyState e m
- addHandler :: ErrorHandler e m -> ScottyState e m -> ScottyState e m
- newtype ScottyT e m a = ScottyT {
- runS :: StateT (ScottyState e m) m a
- data ActionError e
- = Redirect Text
- | Next
- | ActionError e
- class ScottyError e where
- stringError :: String -> e
- showError :: e -> Text
- type ErrorHandler e m = Maybe (e -> ActionT e m ())
- type Param = (Text, Text)
- type File = (Text, FileInfo ByteString)
- data ActionEnv = Env {}
- data Content
- data ScottyResponse = SR {}
- newtype ActionT e m a = ActionT {
- runAM :: ErrorT (ActionError e) (ReaderT ActionEnv (StateT ScottyResponse m)) a
- data RoutePattern
Documentation
Options | |
|
type Middleware m = Application m -> Application mSource
type Application m = Request -> m ResponseSource
data ScottyState e m Source
ScottyState | |
|
Monad m => Default (ScottyState e m) |
addMiddleware :: Middleware -> ScottyState e m -> ScottyState e mSource
addRoute :: Monad m => Middleware m -> ScottyState e m -> ScottyState e mSource
addHandler :: ErrorHandler e m -> ScottyState e m -> ScottyState e mSource
ScottyT | |
|
data ActionError e Source
ScottyError e => Error (ActionError e) | |
ScottyError e => ScottyError (ActionError e) | |
(ScottyError e, Monad m) => MonadError (ActionError e) (ActionT e m) |
class ScottyError e whereSource
In order to use a custom exception type (aside from Text
), you must
define an instance of ScottyError
for that type.
ScottyError Text | |
ScottyError e => ScottyError (ActionError e) |
type ErrorHandler e m = Maybe (e -> ActionT e m ())Source
type File = (Text, FileInfo ByteString)Source
data ScottyResponse Source
ActionT | |
|
(MonadBase b m, ScottyError e) => MonadBase b (ActionT e m) | |
(ScottyError e, MonadBaseControl b m) => MonadBaseControl b (ActionT e m) | |
ScottyError e => MonadTrans (ActionT e) | |
ScottyError e => MonadTransControl (ActionT e) | |
(ScottyError e, Monad m) => MonadError (ActionError e) (ActionT e m) | |
(Monad m, ScottyError e) => Monad (ActionT e m) | |
Functor m => Functor (ActionT e m) | |
(Monad m, Functor m) => Applicative (ActionT e m) | |
(MonadIO m, ScottyError e) => MonadIO (ActionT e m) |