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

Servant.API.Routes.Internal.Request

Description

Internal module, subject to change.

Synopsis

Documentation

newtype Request Source #

A representation of the request body(s) that a Servant endpoint expects.

Under the hood, Request is a Some TypeRep. This allows for the possibility that an endpoint might expect the request body to parse as several different types (multiple ReqBody's).

Note that this type doesn't include any information about the headers that an endpoint expects, since those are independent of the request body.

Constructors

Request 

class AllTypeable (as :: [Type]) where Source #

This class does 2 things:

  • It lets us get a term-level list of TypeReps from a type-level list of types, all of which have Typeable instances.
  • More impressively, its instances enforce that typeReps will only type-check for type-level lists of length 2 or more. This is because AllTypeable will only ever be used by allOfRequests, which is the only way to construct a Many @Request and thus lets us enforce the invariant that its list arguments will always have more than 1 element. This lets us make sure that there's only ever one way to represent a list of TypeReps using Request.

Of course, someone might import this Internal module and define a Typeable a => AllTypeable '[a] instance. Don't do that.

Methods

typeReps :: [TypeRep] Source #

Instances

Instances details
(Typeable a, AllTypeable (b ': (c ': as))) => AllTypeable (a ': (b ': (c ': as))) Source # 
Instance details

Defined in Servant.API.Routes.Internal.Request

Methods

typeReps :: [TypeRep] Source #

(Typeable a, Typeable b) => AllTypeable '[a, b] Source # 
Instance details

Defined in Servant.API.Routes.Internal.Request

Methods

typeReps :: [TypeRep] Source #