License | BSD3 |
---|---|
Maintainer | Nickolay Kudasov <nickolay@getshoptv.com> |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Useful type families for servant APIs.
Synopsis
- type family IsSubAPI sub api :: Constraint where ...
- type family EndpointsList api where ...
- type BodyTypes c api = Nub (BodyTypes' c api)
Documentation
type family IsSubAPI sub api :: Constraint where ... Source #
Check whether sub
is a sub API of api
.
IsSubAPI sub api = AllIsElem (EndpointsList sub) api |
type family EndpointsList api where ... Source #
Build a list of endpoints from an API.
EndpointsList (a :<|> b) = AppendList (EndpointsList a) (EndpointsList b) | |
EndpointsList (e :> a) = MapSub e (EndpointsList a) | |
EndpointsList (NamedRoutes api) = EndpointsList (ToServantApi api) | |
EndpointsList a = '[a] |
type BodyTypes c api = Nub (BodyTypes' c api) Source #
Extract a list of unique "body" types for a specific content-type from a servant API.