servant-0.13.0.1: A family of combinators for defining webservices APIs

Safe HaskellSafe
LanguageHaskell2010

Servant.API.WithNamedContext

Synopsis

Documentation

data WithNamedContext (name :: Symbol) (subContext :: [*]) subApi Source #

WithNamedContext names a specific tagged context to use for the combinators in the API. (See also in servant-server, Servant.Server.Context.) For example:

type UseNamedContextAPI = WithNamedContext "myContext" '[String] (
    ReqBody '[JSON] Int :> Get '[JSON] Int)

Both the ReqBody and Get combinators will use the WithNamedContext with type tag "myContext" as their context.

Contexts are only relevant for servant-server.

For more information, see the tutorial.

Instances

HasLink * sub => HasLink * (WithNamedContext name context sub) Source # 

Associated Types

type MkLink (WithNamedContext name context sub) (endpoint :: WithNamedContext name context sub) :: * Source #

Methods

toLink :: Proxy (WithNamedContext name context sub) endpoint -> Link -> MkLink (WithNamedContext name context sub) endpoint Source #

type MkLink * (WithNamedContext name context sub) Source # 
type MkLink * (WithNamedContext name context sub) = MkLink * sub