trasa-server-0.5.4: Type safe web server

Safe HaskellNone
LanguageHaskell2010

Trasa.Server

Documentation

data TrasaT m a Source #

Instances
MonadTrans TrasaT Source # 
Instance details

Defined in Trasa.Server

Methods

lift :: Monad m => m a -> TrasaT m a #

Monad m => MonadReader TrasaEnv (TrasaT m) Source # 
Instance details

Defined in Trasa.Server

Methods

ask :: TrasaT m TrasaEnv #

local :: (TrasaEnv -> TrasaEnv) -> TrasaT m a -> TrasaT m a #

reader :: (TrasaEnv -> a) -> TrasaT m a #

Monad m => MonadError TrasaErr (TrasaT m) Source # 
Instance details

Defined in Trasa.Server

Methods

throwError :: TrasaErr -> TrasaT m a #

catchError :: TrasaT m a -> (TrasaErr -> TrasaT m a) -> TrasaT m a #

Monad m => Monad (TrasaT m) Source # 
Instance details

Defined in Trasa.Server

Methods

(>>=) :: TrasaT m a -> (a -> TrasaT m b) -> TrasaT m b #

(>>) :: TrasaT m a -> TrasaT m b -> TrasaT m b #

return :: a -> TrasaT m a #

fail :: String -> TrasaT m a #

Functor m => Functor (TrasaT m) Source # 
Instance details

Defined in Trasa.Server

Methods

fmap :: (a -> b) -> TrasaT m a -> TrasaT m b #

(<$) :: a -> TrasaT m b -> TrasaT m a #

Monad m => Applicative (TrasaT m) Source # 
Instance details

Defined in Trasa.Server

Methods

pure :: a -> TrasaT m a #

(<*>) :: TrasaT m (a -> b) -> TrasaT m a -> TrasaT m b #

liftA2 :: (a -> b -> c) -> TrasaT m a -> TrasaT m b -> TrasaT m c #

(*>) :: TrasaT m a -> TrasaT m b -> TrasaT m b #

(<*) :: TrasaT m a -> TrasaT m b -> TrasaT m a #

(Alternative m, Monad m) => Alternative (TrasaT m) Source # 
Instance details

Defined in Trasa.Server

Methods

empty :: TrasaT m a #

(<|>) :: TrasaT m a -> TrasaT m a -> TrasaT m a #

some :: TrasaT m a -> TrasaT m [a] #

many :: TrasaT m a -> TrasaT m [a] #

(Monad m, Alternative m) => MonadPlus (TrasaT m) Source # 
Instance details

Defined in Trasa.Server

Methods

mzero :: TrasaT m a #

mplus :: TrasaT m a -> TrasaT m a -> TrasaT m a #

MonadIO m => MonadIO (TrasaT m) Source # 
Instance details

Defined in Trasa.Server

Methods

liftIO :: IO a -> TrasaT m a #

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

Defined in Trasa.Server

Methods

(<>) :: TrasaT m a -> TrasaT m a -> TrasaT m a #

sconcat :: NonEmpty (TrasaT m a) -> TrasaT m a #

stimes :: Integral b => b -> TrasaT m a -> TrasaT m a #

(Monad m, Monoid a) => Monoid (TrasaT m a) Source # 
Instance details

Defined in Trasa.Server

Methods

mempty :: TrasaT m a #

mappend :: TrasaT m a -> TrasaT m a -> TrasaT m a #

mconcat :: [TrasaT m a] -> TrasaT m a #

Monad m => MonadState (Map (CI ByteString) Text) (TrasaT m) Source # 
Instance details

Defined in Trasa.Server

Methods

get :: TrasaT m (Map (CI ByteString) Text) #

put :: Map (CI ByteString) Text -> TrasaT m () #

state :: (Map (CI ByteString) Text -> (a, Map (CI ByteString) Text)) -> TrasaT m a #

data TrasaEnv Source #

Constructors

TrasaEnv 
Instances
Monad m => MonadReader TrasaEnv (TrasaT m) Source # 
Instance details

Defined in Trasa.Server

Methods

ask :: TrasaT m TrasaEnv #

local :: (TrasaEnv -> TrasaEnv) -> TrasaT m a -> TrasaT m a #

reader :: (TrasaEnv -> a) -> TrasaT m a #

runTrasaT Source #

Arguments

:: TrasaT m a 
-> Map (CI ByteString) Text

Headers

-> QueryString

Query string parameters

-> m (Either TrasaErr a, Map (CI ByteString) Text) 

mapTrasaT :: (forall x. m x -> n x) -> TrasaT m a -> TrasaT n a Source #

serveWith Source #

Arguments

:: (forall caps qrys req resp. route caps qrys req resp -> MetaServer caps qrys req resp) 
-> (forall caps qrys req resp. route caps qrys req resp -> Rec Identity caps -> Rec Parameter qrys -> RequestBody Identity req -> TrasaT IO resp)

Actions to perform when requests come in

-> Router route

Router

-> Application

Wai Application