Safe Haskell | None |
---|---|
Language | Haskell2010 |
- 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 m Source
type Application m = Request -> m Response Source
data ScottyState e m Source
ScottyState | |
|
Monad m => Default (ScottyState e m) |
addMiddleware :: Middleware -> ScottyState e m -> ScottyState e m Source
addRoute :: Monad m => Middleware m -> ScottyState e m -> ScottyState e m Source
addHandler :: ErrorHandler e m -> ScottyState e m -> ScottyState e m Source
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 where Source
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) | |
type StT (ActionT e) a = StT (StateT ScottyResponse) (StT (ReaderT ActionEnv) (StT (ErrorT (ActionError e)) a)) | |
type StM (ActionT e m) a = ComposeSt (ActionT e) m a |