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 :: 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 :: State (ScottyState e 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 {
- getReq :: Request
- getParams :: [Param]
- getBody :: IO ByteString
- getBodyChunk :: IO ByteString
- getFiles :: [File]
- data RequestBodyState
- data BodyPartiallyStreamed = BodyPartiallyStreamed
- data Content
- data ScottyResponse = SR {}
- newtype ActionT e m a = ActionT {
- runAM :: ExceptT (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 | |
|
Default (ScottyState e m) Source |
addMiddleware :: Middleware -> ScottyState e m -> ScottyState e m Source
addRoute :: 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 => ScottyError (ActionError e) Source | |
(ScottyError e, Monad m) => MonadError (ActionError e) (ActionT e m) Source |
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 Source | |
ScottyError e => ScottyError (ActionError e) Source |
type ErrorHandler e m = Maybe (e -> ActionT e m ()) Source
type File = (Text, FileInfo ByteString) Source
Env | |
|
data ScottyResponse Source
ActionT | |
|
(MonadBase b m, ScottyError e) => MonadBase b (ActionT e m) Source | |
(ScottyError e, MonadBaseControl b m) => MonadBaseControl b (ActionT e m) Source | |
MonadTrans (ActionT e) Source | |
MonadTransControl (ActionT e) Source | |
(ScottyError e, Monad m) => MonadError (ActionError e) (ActionT e m) Source | |
(Monad m, ScottyError e) => Monad (ActionT e m) Source | |
Functor m => Functor (ActionT e m) Source | |
Monad m => Applicative (ActionT e m) Source | |
(Monad m, ScottyError e) => Alternative (ActionT e m) Source | |
(Monad m, ScottyError e) => MonadPlus (ActionT e m) Source | |
(MonadIO m, ScottyError e) => MonadIO (ActionT e m) Source | |
type StT (ActionT e) a = StT (StateT ScottyResponse) (StT (ReaderT ActionEnv) (StT (ExceptT (ActionError e)) a)) Source | |
type StM (ActionT e m) a = ComposeSt (ActionT e) m a Source |