servant-util-0.2: Servant servers utilities.
Safe HaskellNone
LanguageHaskell2010

Servant.Util.Common.Common

Synopsis

Documentation

type family ApplicationLS x where ... Source #

Equations

ApplicationLS (a b) = a 

type family ApplicationRS x where ... Source #

Extract right side of type application.

Equations

ApplicationRS (a b) = b 

class ApiHasArgClass api where Source #

Proves info about argument specifier of servant API.

Minimal complete definition

Nothing

Associated Types

type ApiArg api :: Type Source #

For arguments-specifiers of API, get argument type. E.g. Capture "cap" Int -> Int.

type ApiArg api = ApplicationRS api

Methods

apiArgName :: Proxy api -> String Source #

Name of argument. E.g. name of argument specified by Capture "nyan" is nyan.

default apiArgName :: forall n someApiType a. (KnownSymbol n, api ~ someApiType n a) => Proxy api -> String Source #

Instances

Instances details
KnownSymbol s => ApiHasArgClass (QueryFlag s) Source # 
Instance details

Defined in Servant.Util.Common.Common

Associated Types

type ApiArg (QueryFlag s) Source #

ApiHasArgClass (ReqBody ct a) Source # 
Instance details

Defined in Servant.Util.Common.Common

Associated Types

type ApiArg (ReqBody ct a) Source #

Methods

apiArgName :: Proxy (ReqBody ct a) -> String Source #

KnownSymbol s => ApiHasArgClass (Capture s a) Source # 
Instance details

Defined in Servant.Util.Common.Common

Associated Types

type ApiArg (Capture s a) Source #

Methods

apiArgName :: Proxy (Capture s a) -> String Source #

KnownSymbol s => ApiHasArgClass (QueryParam' mods s a) Source # 
Instance details

Defined in Servant.Util.Common.Common

Associated Types

type ApiArg (QueryParam' mods s a) Source #

Methods

apiArgName :: Proxy (QueryParam' mods s a) -> String Source #

type ApiHasArg subApi res = (ApiHasArgClass subApi, ApiHasArgInvariant subApi res Handler) Source #

inRouteServer :: forall api api' ctx env. (Proxy api -> Context ctx -> Delayed env (Server api) -> Router env) -> (Server api' -> Server api) -> Proxy api' -> Context ctx -> Delayed env (Server api') -> Router env Source #

Modify handler in implementation of route.

symbolValT :: forall s. KnownSymbol s => Text Source #

Similar to symbolVal, but shorter in use.

data NameLabel (name :: Symbol) Source #

Helper for passing type-level symbol at term-level. We do not use Proxy for this because defining instance IsLabel name (Proxy name) in a library is not a really good idea.

Constructors

NameLabel 

Instances

Instances details
n1 ~ n2 => IsLabel n1 (NameLabel n2) Source # 
Instance details

Defined in Servant.Util.Common.Common

Methods

fromLabel :: NameLabel n2 #