scotty-0.12.1: Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp
Safe HaskellSafe-Inferred
LanguageHaskell2010

Web.Scotty.Internal.Types

Synopsis

Documentation

data Options Source #

Constructors

Options 

Fields

  • verbose :: Int

    0 = silent, 1(def) = startup banner

  • settings :: Settings

    Warp Settings Note: to work around an issue in warp, the default FD cache duration is set to 0 so changes to static files are always picked up. This likely has performance implications, so you may want to modify this for production servers using setFdCacheDuration.

Instances

Instances details
Default Options Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

def :: Options

newtype RouteOptions Source #

Constructors

RouteOptions 

Fields

Instances

Instances details
Default RouteOptions Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

def :: RouteOptions

type Kilobytes = Int Source #

type Application m = Request -> m Response Source #

data ScottyState e m Source #

Constructors

ScottyState 

Fields

Instances

Instances details
Default (ScottyState e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

def :: ScottyState e m

addMiddleware :: Middleware -> ScottyState e m -> ScottyState e m Source #

newtype ScottyT e m a Source #

Constructors

ScottyT 

Fields

Instances

Instances details
Applicative (ScottyT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

pure :: a -> ScottyT e m a

(<*>) :: ScottyT e m (a -> b) -> ScottyT e m a -> ScottyT e m b

liftA2 :: (a -> b -> c) -> ScottyT e m a -> ScottyT e m b -> ScottyT e m c

(*>) :: ScottyT e m a -> ScottyT e m b -> ScottyT e m b

(<*) :: ScottyT e m a -> ScottyT e m b -> ScottyT e m a

Functor (ScottyT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

fmap :: (a -> b) -> ScottyT e m a -> ScottyT e m b

(<$) :: a -> ScottyT e m b -> ScottyT e m a

Monad (ScottyT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

(>>=) :: ScottyT e m a -> (a -> ScottyT e m b) -> ScottyT e m b

(>>) :: ScottyT e m a -> ScottyT e m b -> ScottyT e m b

return :: a -> ScottyT e m a

Monoid a => Monoid (ScottyT e m a) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

mempty :: ScottyT e m a

mappend :: ScottyT e m a -> ScottyT e m a -> ScottyT e m a

mconcat :: [ScottyT e m a] -> ScottyT e m a

Semigroup a => Semigroup (ScottyT e m a) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

(<>) :: ScottyT e m a -> ScottyT e m a -> ScottyT e m a

sconcat :: NonEmpty (ScottyT e m a) -> ScottyT e m a

stimes :: Integral b => b -> ScottyT e m a -> ScottyT e m a

data ActionError e Source #

Constructors

Redirect Text 
Next 
Finish 
ActionError Status e 

Instances

Instances details
ScottyError e => ScottyError (ActionError e) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

stringError :: String -> ActionError e Source #

showError :: ActionError e -> Text Source #

(ScottyError e, Monad m) => MonadError (ActionError e) (ActionT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

throwError :: ActionError e -> ActionT e m a

catchError :: ActionT e m a -> (ActionError e -> ActionT e m a) -> ActionT e m a

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.

Methods

stringError :: String -> e Source #

showError :: e -> Text Source #

Instances

Instances details
ScottyError Text Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

stringError :: String -> Text Source #

showError :: Text -> Text Source #

ScottyError e => ScottyError (ActionError e) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

stringError :: String -> ActionError e Source #

showError :: ActionError e -> Text Source #

type ErrorHandler e m = Maybe (e -> ActionT e m ()) Source #

data ScottyException Source #

Constructors

RequestException ByteString Status 

Instances

Instances details
Exception ScottyException Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

toException :: ScottyException -> SomeException

fromException :: SomeException -> Maybe ScottyException

displayException :: ScottyException -> String

Show ScottyException Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

showsPrec :: Int -> ScottyException -> ShowS

show :: ScottyException -> String

showList :: [ScottyException] -> ShowS

type Param = (Text, Text) Source #

type File = (Text, FileInfo ByteString) Source #

data ActionEnv Source #

Constructors

Env 

Fields

data RequestBodyState Source #

Constructors

BodyUntouched 
BodyCached ByteString [ByteString] 
BodyCorrupted 

data BodyPartiallyStreamed Source #

Constructors

BodyPartiallyStreamed 

Instances

Instances details
Exception BodyPartiallyStreamed Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

toException :: BodyPartiallyStreamed -> SomeException

fromException :: SomeException -> Maybe BodyPartiallyStreamed

displayException :: BodyPartiallyStreamed -> String

Show BodyPartiallyStreamed Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

showsPrec :: Int -> BodyPartiallyStreamed -> ShowS

show :: BodyPartiallyStreamed -> String

showList :: [BodyPartiallyStreamed] -> ShowS

data Content Source #

Constructors

ContentBuilder Builder 
ContentFile FilePath 
ContentStream StreamingBody 

data ScottyResponse Source #

Constructors

SR 

Fields

Instances

Instances details
Default ScottyResponse Source # 
Instance details

Defined in Web.Scotty.Internal.Types

newtype ActionT e m a Source #

Constructors

ActionT 

Fields

Instances

Instances details
(ScottyError e, MonadBaseControl b m) => MonadBaseControl b (ActionT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Associated Types

type StM (ActionT e m) a

Methods

liftBaseWith :: (RunInBase (ActionT e m) b -> b a) -> ActionT e m a

restoreM :: StM (ActionT e m) a -> ActionT e m a

(MonadReader r m, ScottyError e) => MonadReader r (ActionT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

ask :: ActionT e m r

local :: (r -> r) -> ActionT e m a -> ActionT e m a

reader :: (r -> a) -> ActionT e m a

(MonadState s m, ScottyError e) => MonadState s (ActionT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

get :: ActionT e m s

put :: s -> ActionT e m ()

state :: (s -> (a, s)) -> ActionT e m a

(MonadBase b m, ScottyError e) => MonadBase b (ActionT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

liftBase :: b α -> ActionT e m α

ScottyError e => MonadTransControl (ActionT e) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Associated Types

type StT (ActionT e) a

Methods

liftWith :: Monad m => (Run (ActionT e) -> m a) -> ActionT e m a

restoreT :: Monad m => m (StT (ActionT e) a) -> ActionT e m a

ScottyError e => MonadTrans (ActionT e) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

lift :: Monad m => m a -> ActionT e m a

(ScottyError e, Monad m) => MonadError (ActionError e) (ActionT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

throwError :: ActionError e -> ActionT e m a

catchError :: ActionT e m a -> (ActionError e -> ActionT e m a) -> ActionT e m a

(Monad m, ScottyError e) => MonadFail (ActionT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

fail :: String -> ActionT e m a

(ScottyError e, MonadIO m) => MonadIO (ActionT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

liftIO :: IO a -> ActionT e m a

(Monad m, ScottyError e) => Alternative (ActionT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

empty :: ActionT e m a

(<|>) :: ActionT e m a -> ActionT e m a -> ActionT e m a

some :: ActionT e m a -> ActionT e m [a]

many :: ActionT e m a -> ActionT e m [a]

Monad m => Applicative (ActionT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

pure :: a -> ActionT e m a

(<*>) :: ActionT e m (a -> b) -> ActionT e m a -> ActionT e m b

liftA2 :: (a -> b -> c) -> ActionT e m a -> ActionT e m b -> ActionT e m c

(*>) :: ActionT e m a -> ActionT e m b -> ActionT e m b

(<*) :: ActionT e m a -> ActionT e m b -> ActionT e m a

Functor m => Functor (ActionT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

fmap :: (a -> b) -> ActionT e m a -> ActionT e m b

(<$) :: a -> ActionT e m b -> ActionT e m a

(Monad m, ScottyError e) => Monad (ActionT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

(>>=) :: ActionT e m a -> (a -> ActionT e m b) -> ActionT e m b

(>>) :: ActionT e m a -> ActionT e m b -> ActionT e m b

return :: a -> ActionT e m a

(Monad m, ScottyError e) => MonadPlus (ActionT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

mzero :: ActionT e m a

mplus :: ActionT e m a -> ActionT e m a -> ActionT e m a

(MonadCatch m, ScottyError e) => MonadCatch (ActionT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

catch :: Exception e0 => ActionT e m a -> (e0 -> ActionT e m a) -> ActionT e m a

(MonadThrow m, ScottyError e) => MonadThrow (ActionT e m) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

throwM :: Exception e0 => e0 -> ActionT e m a

(Monad m, ScottyError e, Monoid a) => Monoid (ActionT e m a) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

mempty :: ActionT e m a

mappend :: ActionT e m a -> ActionT e m a -> ActionT e m a

mconcat :: [ActionT e m a] -> ActionT e m a

(Monad m, Semigroup a) => Semigroup (ActionT e m a) Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

(<>) :: ActionT e m a -> ActionT e m a -> ActionT e m a

sconcat :: NonEmpty (ActionT e m a) -> ActionT e m a

stimes :: Integral b => b -> ActionT e m a -> ActionT e m a

type StT (ActionT e) a Source # 
Instance details

Defined in Web.Scotty.Internal.Types

type StT (ActionT e) a = StT (StateT ScottyResponse) (StT (ReaderT ActionEnv) (StT (ExceptT (ActionError e)) a))
type StM (ActionT e m) a Source # 
Instance details

Defined in Web.Scotty.Internal.Types

type StM (ActionT e m) a = ComposeSt (ActionT e) m a

data RoutePattern Source #

Constructors

Capture Text 
Literal Text 
Function (Request -> Maybe [Param]) 

Instances

Instances details
IsString RoutePattern Source # 
Instance details

Defined in Web.Scotty.Internal.Types

Methods

fromString :: String -> RoutePattern