servant-routes-0.1.0.0: Generate route descriptions from Servant APIs
Copyright(c) Frederick Pringle 2024
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Servant.API.Routes.Header

Description

Simple representation of HTTP headers.

Synopsis

Documentation

data HeaderRep Source #

Simple term-level representation of a Header.

A type-level Header (sym :: Symbol) typ should correspond to HeaderRep { _hName = str, _hType = typRep }, where str is the term-level equivalent of sym and typRep is the term-level representation of typ.

class GetHeaderReps (hs :: [Type]) where Source #

Utility class to let us get a value-level list of HeaderReps from a type-level list of Headers. See the implementation of HasRoutes (Verb method status ctypes (Headers hs a)) for an example.

Instances

Instances details
GetHeaderReps ('[] :: [Type]) Source # 
Instance details

Defined in Servant.API.Routes.Header

(GetHeaderReps rest, KnownSymbol h, Typeable v) => GetHeaderReps (Header h v ': rest) Source # 
Instance details

Defined in Servant.API.Routes.Header

mkHeaderRep :: forall sym a. (KnownSymbol sym, Typeable a) => HeaderRep Source #

Convenience function to construct a HeaderRep from sym :: Symbol and a :: Type'.