Convenience function for supplying arguments to client functions when
working with records of clients.
Intended to be used in conjunction with
(//).
Example:
type Api = NamedRoutes RootApi
data RootApi mode = RootApi
{ subApi :: mode :- Capture "token" String :> NamedRoutes SubApi
, hello :: mode :- Capture "name" String :> Get '[JSON] String
, …
} deriving Generic
data SubApi mode = SubApi
{ endpoint :: mode :- Get '[JSON] Person
, …
} deriving Generic
api :: Proxy API
api = Proxy
rootClient :: RootApi (AsClientT ClientM)
rootClient = client api
hello :: String -> ClientM String
hello name = rootClient // hello /: name
endpointClient :: ClientM Person
endpointClient = client // subApi /: "foobar123" // endpoint