| Copyright | (c) Frederick Pringle 2025 |
|---|---|
| License | BSD-3-Clause |
| Maintainer | freddyjepringle@gmail.com |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Servant.API.Routes.Internal.Request
Description
Internal module, subject to change.
Documentation
A representation of the request body(s) that a Servant endpoint expects.
Under the hood, Request is a .
This allows for the possibility that an endpoint might expect the request body
to parse as several different types (multiple Some TypeRepReqBody'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 | |
Fields | |
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 haveTypeableinstances. - More impressively, its instances enforce that
typeRepswill only type-check for type-level lists of length 2 or more. This is becauseAllTypeablewill only ever be used byallOfRequests, which is the only way to construct aMany@Requestand 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 ofTypeReps usingRequest.
Of course, someone might import this Internal module and define a
instance. Don't do that.Typeable a => AllTypeable '[a]
Instances
| (Typeable a, AllTypeable (b ': (c ': as))) => AllTypeable (a ': (b ': (c ': as))) Source # | |
Defined in Servant.API.Routes.Internal.Request | |
| (Typeable a, Typeable b) => AllTypeable '[a, b] Source # | |
Defined in Servant.API.Routes.Internal.Request | |