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

Safe Haskell | None
Language | Haskell2010

Servant.API.WithNamedContext

Synopsis

- data WithNamedContext (name :: Symbol) (subContext :: [Type]) (subApi :: k)

# Documentation

data WithNamedContext (name :: Symbol) (subContext :: [Type]) (subApi :: k) #

`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.

`Context`s are only relevant for `servant-server`.

For more information, see the tutorial.

#### Instances

Instances details

HasLink sub => HasLink (WithNamedContext name context sub :: Type) # |
Instance details Defined in Servant.Links Methods toLink :: (Link -> a) -> Proxy (WithNamedContext name context sub) -> Link -> MkLink (WithNamedContext name context sub) a #
type MkLink (WithNamedContext name context sub :: Type) a # |
Instance details Defined in Servant.Links type MkLink (WithNamedContext name context sub :: Type) a = MkLink sub a