@@ -1,15 +1,16 @@
1−{-# LANGUAGE AllowAmbiguousTypes #-}
1+{-# LANGUAGE AllowAmbiguousTypes #-}
2−{-# LANGUAGE CPP #-}
2+{-# LANGUAGE CPP #-}
3−{-# LANGUAGE DataKinds #-}
3+{-# LANGUAGE DataKinds #-}
4−{-# LANGUAGE FlexibleContexts #-}
4+{-# LANGUAGE FlexibleContexts #-}
5−{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE FlexibleInstances #-}
6−{-# LANGUAGE InstanceSigs #-}
6+{-# LANGUAGE InstanceSigs #-}
7+{-# LANGUAGE MultiParamTypeClasses #-}
7−{-# LANGUAGE OverloadedStrings #-}
8+{-# LANGUAGE OverloadedStrings #-}
8−{-# LANGUAGE PolyKinds #-}
9+{-# LANGUAGE PolyKinds #-}
9−{-# LANGUAGE ScopedTypeVariables #-}
10+{-# LANGUAGE ScopedTypeVariables #-}
10−{-# LANGUAGE TypeFamilies #-}
11+{-# LANGUAGE TypeFamilies #-}
11−{-# LANGUAGE TypeOperators #-}
12+{-# LANGUAGE TypeOperators #-}
12−{-# LANGUAGE UndecidableInstances #-}
13+{-# LANGUAGE UndecidableInstances #-}
14#include "overlapping-compat.h"
15#include "overlapping-compat.h"
15-- | This module provides 'client' which can automatically generate
16-- | This module provides 'client' which can automatically generate
@@ -62,15 +63,15 @@ import Servant.Common.Req
62-- > getAllBooks :: ClientM [Book]
63-- > getAllBooks :: ClientM [Book]
63-- > postNewBook :: Book -> ClientM Book
64-- > postNewBook :: Book -> ClientM Book
64-- > (getAllBooks :<|> postNewBook) = client myApi
65-- > (getAllBooks :<|> postNewBook) = client myApi
65−client :: HasClient api => Proxy api -> Client m api
66+client :: HasClient m api => Proxy m -> Proxy api -> Client m api
66−client p = clientWithRoute p defReq
67+client pm p = clientWithRoute pm p defReq
68-- | This class lets us define how each API combinator
69-- | This class lets us define how each API combinator
69-- influences the creation of an HTTP request. It's mostly
70-- influences the creation of an HTTP request. It's mostly
70-- an internal class, you can just use 'client'.
71-- an internal class, you can just use 'client'.
71−class HasClient api where
72+class HasClient m api where
72 type Client (m :: * -> *) (api :: *) :: *
73 type Client (m :: * -> *) (api :: *) :: *
73− clientWithRoute :: Proxy api -> Req -> Client m api
74+ clientWithRoute :: Proxy m -> Proxy api -> Req -> Client m api
76-- | A client querying function for @a ':<|>' b@ will actually hand you
77-- | A client querying function for @a ':<|>' b@ will actually hand you
@@ -86,11 +87,11 @@ class HasClient api where
86-- > getAllBooks :: ClientM [Book]
87-- > getAllBooks :: ClientM [Book]
87-- > postNewBook :: Book -> ClientM Book
88-- > postNewBook :: Book -> ClientM Book
88-- > (getAllBooks :<|> postNewBook) = client myApi
89-- > (getAllBooks :<|> postNewBook) = client myApi
89−instance (HasClient a, HasClient b) => HasClient (a :<|> b) where
90+instance (HasClient m a, HasClient m b) => HasClient m (a :<|> b) where
90 type Client m (a :<|> b) = Client m a :<|> Client m b
91 type Client m (a :<|> b) = Client m a :<|> Client m b
91− clientWithRoute Proxy req =
92+ clientWithRoute pm Proxy req =
92− clientWithRoute (Proxy :: Proxy a) req :<|>
93+ clientWithRoute pm (Proxy :: Proxy a) req :<|>
93− clientWithRoute (Proxy :: Proxy b) req
94+ clientWithRoute pm (Proxy :: Proxy b) req
95-- | Singleton type representing a client for an empty API.
96-- | Singleton type representing a client for an empty API.
96data EmptyClient = EmptyClient deriving (Eq, Show, Bounded, Enum)
97data EmptyClient = EmptyClient deriving (Eq, Show, Bounded, Enum)
@@ -105,9 +106,9 @@ data EmptyClient = EmptyClient deriving (Eq, Show, Bounded, Enum)
106-- > getAllBooks :: ClientM [Book]
107-- > getAllBooks :: ClientM [Book]
107-- > (getAllBooks :<|> EmptyClient) = client myApi
108-- > (getAllBooks :<|> EmptyClient) = client myApi
108−instance HasClient EmptyAPI where
109+instance HasClient m EmptyAPI where
109 type Client m EmptyAPI = EmptyClient
110 type Client m EmptyAPI = EmptyClient
110− clientWithRoute Proxy _ = EmptyClient
111+ clientWithRoute pm Proxy _ = EmptyClient
112-- | If you use a 'Capture' in one of your endpoints in your API,
113-- | If you use a 'Capture' in one of your endpoints in your API,
113-- the corresponding querying function will automatically take
114-- the corresponding querying function will automatically take
@@ -128,14 +129,14 @@ instance HasClient EmptyAPI where
128-- > getBook :: Text -> ClientM Book
129-- > getBook :: Text -> ClientM Book
129-- > getBook = client myApi
130-- > getBook = client myApi
130-- > -- then you can just use "getBook" to query that endpoint
131-- > -- then you can just use "getBook" to query that endpoint
131−instance (KnownSymbol capture, ToHttpApiData a, HasClient api)
132+instance (KnownSymbol capture, ToHttpApiData a, HasClient m api)
132− => HasClient (Capture capture a :> api) where
133+ => HasClient m (Capture capture a :> api) where
134 type Client m (Capture capture a :> api) =
135 type Client m (Capture capture a :> api) =
135 a -> Client m api
136 a -> Client m api
137− clientWithRoute Proxy req val =
138+ clientWithRoute pm Proxy req val =
138− clientWithRoute (Proxy :: Proxy api)
139+ clientWithRoute pm (Proxy :: Proxy api)
139 (appendToPath p req)
140 (appendToPath p req)
141 where p = unpack (toUrlPiece val)
142 where p = unpack (toUrlPiece val)
@@ -160,14 +161,14 @@ instance (KnownSymbol capture, ToHttpApiData a, HasClient api)
160-- > getSourceFile :: [Text] -> ClientM SourceFile
161-- > getSourceFile :: [Text] -> ClientM SourceFile
161-- > getSourceFile = client myApi
162-- > getSourceFile = client myApi
162-- > -- then you can use "getSourceFile" to query that endpoint
163-- > -- then you can use "getSourceFile" to query that endpoint
163−instance (KnownSymbol capture, ToHttpApiData a, HasClient sublayout)
164+instance (KnownSymbol capture, ToHttpApiData a, HasClient m sublayout)
164− => HasClient (CaptureAll capture a :> sublayout) where
165+ => HasClient m (CaptureAll capture a :> sublayout) where
166 type Client m (CaptureAll capture a :> sublayout) =
167 type Client m (CaptureAll capture a :> sublayout) =
167 [a] -> Client m sublayout
168 [a] -> Client m sublayout
169− clientWithRoute Proxy req vals =
170+ clientWithRoute pm Proxy req vals =
170− clientWithRoute (Proxy :: Proxy sublayout)
171+ clientWithRoute pm (Proxy :: Proxy sublayout)
171 (foldl' (flip appendToPath) req ps)
172 (foldl' (flip appendToPath) req ps)
173 where ps = map (unpack . toUrlPiece) vals
174 where ps = map (unpack . toUrlPiece) vals
@@ -175,27 +176,31 @@ instance (KnownSymbol capture, ToHttpApiData a, HasClient sublayout)
175instance OVERLAPPABLE_
176instance OVERLAPPABLE_
176 -- Note [Non-Empty Content Types]
177 -- Note [Non-Empty Content Types]
177 (RunClient m ct ([H.Header], a), MimeUnrender ct a, ReflectMethod method, cts' ~ (ct ': cts)
178 (RunClient m ct ([H.Header], a), MimeUnrender ct a, ReflectMethod method, cts' ~ (ct ': cts)
178− ) => HasClient (Verb method status cts' a) where
179+ ) => HasClient m (Verb method status cts' a) where
179 type Client m (Verb method status cts' a) = m a
180 type Client m (Verb method status cts' a) = m a
180− clientWithRoute Proxy req = do
181+ clientWithRoute pm Proxy req = do
181− snd <$> runRequest (Proxy :: Proxy ct) method req
182+ (_hdrs, a) :: ([H.Header], a) <- runRequest (Proxy :: Proxy ct) method req
182 where method = reflectMethod (Proxy :: Proxy method)
184 where method = reflectMethod (Proxy :: Proxy method)
184instance OVERLAPPING_
186instance OVERLAPPING_
187+ ( RunClient m NoContent [HTTP.Header]
185− (RunClient m NoContent [H.Header], ReflectMethod method) => HasClient (Verb method status cts NoContent) where
188+ , ReflectMethod method) => HasClient m (Verb method status cts NoContent) where
186 type Client m (Verb method status cts NoContent)
189 type Client m (Verb method status cts NoContent)
187 = m NoContent
190 = m NoContent
188− clientWithRoute Proxy req = do
191+ clientWithRoute pm Proxy req = do
189− runRequest (Proxy :: Proxy NoContent) method req >> return NoContent
192+ _hdrs :: [H.Header] <- runRequest (Proxy :: Proxy NoContent) method req
190 where method = reflectMethod (Proxy :: Proxy method)
194 where method = reflectMethod (Proxy :: Proxy method)
192instance OVERLAPPING_
196instance OVERLAPPING_
193 -- Note [Non-Empty Content Types]
197 -- Note [Non-Empty Content Types]
198+ ( RunClient m ct ([H.Header], a)
194− ( RunClient m ct ([H.Header], a), MimeUnrender ct a, BuildHeadersTo ls, ReflectMethod method, cts' ~ (ct ': cts)
199+ , MimeUnrender ct a, BuildHeadersTo ls, ReflectMethod method, cts' ~ (ct ': cts)
195− ) => HasClient (Verb method status cts' (Headers ls a)) where
200+ ) => HasClient m (Verb method status cts' (Headers ls a)) where
196 type Client m (Verb method status cts' (Headers ls a))
201 type Client m (Verb method status cts' (Headers ls a))
197 = m (Headers ls a)
202 = m (Headers ls a)
198− clientWithRoute Proxy req = do
203+ clientWithRoute pm Proxy req = do
199 let method = reflectMethod (Proxy :: Proxy method)
204 let method = reflectMethod (Proxy :: Proxy method)
200 (hdrs, resp) <- runRequest (Proxy :: Proxy ct) method req
205 (hdrs, resp) <- runRequest (Proxy :: Proxy ct) method req
201 return $ Headers { getResponse = resp
206 return $ Headers { getResponse = resp
@@ -203,13 +208,14 @@ instance OVERLAPPING_
205instance OVERLAPPING_
210instance OVERLAPPING_
211+ ( RunClient m NoContent [H.Header]
206− ( RunClient m NoContent [H.Header], BuildHeadersTo ls, ReflectMethod method
212+ , BuildHeadersTo ls, ReflectMethod method
207− ) => HasClient (Verb method status cts (Headers ls NoContent)) where
213+ ) => HasClient m (Verb method status cts (Headers ls NoContent)) where
208 type Client m (Verb method status cts (Headers ls NoContent))
214 type Client m (Verb method status cts (Headers ls NoContent))
209 = m (Headers ls NoContent)
215 = m (Headers ls NoContent)
210− clientWithRoute Proxy req = do
216+ clientWithRoute pm Proxy req = do
211 let method = reflectMethod (Proxy :: Proxy method)
217 let method = reflectMethod (Proxy :: Proxy method)
212− hdrs <- runRequest method req
218+ hdrs <- runRequest (Proxy :: Proxy NoContent) method req
213 return $ Headers { getResponse = NoContent
219 return $ Headers { getResponse = NoContent
214 , getHeadersHList = buildHeadersTo hdrs
220 , getHeadersHList = buildHeadersTo hdrs
@@ -240,14 +246,14 @@ instance OVERLAPPING_
240-- > viewReferer = client myApi
246-- > viewReferer = client myApi
241-- > -- then you can just use "viewRefer" to query that endpoint
247-- > -- then you can just use "viewRefer" to query that endpoint
242-- > -- specifying Nothing or e.g Just "http://haskell.org/" as arguments
248-- > -- specifying Nothing or e.g Just "http://haskell.org/" as arguments
243−instance (KnownSymbol sym, ToHttpApiData a, HasClient api)
249+instance (KnownSymbol sym, ToHttpApiData a, HasClient m api)
244− => HasClient (Header sym a :> api) where
250+ => HasClient m (Header sym a :> api) where
246 type Client m (Header sym a :> api) =
252 type Client m (Header sym a :> api) =
247 Maybe a -> Client m api
253 Maybe a -> Client m api
249− clientWithRoute Proxy req mval =
255+ clientWithRoute pm Proxy req mval =
250− clientWithRoute (Proxy :: Proxy api)
256+ clientWithRoute pm (Proxy :: Proxy api)
251 (maybe req
257 (maybe req
252 (\value -> Servant.Common.Req.addHeader hname value req)
258 (\value -> Servant.Common.Req.addHeader hname value req)
@@ -257,26 +263,26 @@ instance (KnownSymbol sym, ToHttpApiData a, HasClient api)
258-- | Using a 'HttpVersion' combinator in your API doesn't affect the client
264-- | Using a 'HttpVersion' combinator in your API doesn't affect the client
259-- functions.
265-- functions.
260−instance HasClient api
266+instance HasClient m api
261− => HasClient (HttpVersion :> api) where
267+ => HasClient m (HttpVersion :> api) where
263 type Client m (HttpVersion :> api) =
269 type Client m (HttpVersion :> api) =
264 Client m api
270 Client m api
266− clientWithRoute Proxy =
272+ clientWithRoute pm Proxy =
267− clientWithRoute (Proxy :: Proxy api)
273+ clientWithRoute pm (Proxy :: Proxy api)
269-- | Ignore @'Summary'@ in client functions.
275-- | Ignore @'Summary'@ in client functions.
270−instance HasClient api => HasClient (Summary desc :> api) where
276+instance HasClient m api => HasClient m (Summary desc :> api) where
271 type Client m (Summary desc :> api) = Client m api
277 type Client m (Summary desc :> api) = Client m api
273− clientWithRoute _ = clientWithRoute (Proxy :: Proxy api)
279+ clientWithRoute pm _ = clientWithRoute pm (Proxy :: Proxy api)
275-- | Ignore @'Description'@ in client functions.
281-- | Ignore @'Description'@ in client functions.
276−instance HasClient api => HasClient (Description desc :> api) where
282+instance HasClient m api => HasClient m (Description desc :> api) where
277 type Client m (Description desc :> api) = Client m api
283 type Client m (Description desc :> api) = Client m api
279− clientWithRoute _ = clientWithRoute (Proxy :: Proxy api)
285+ clientWithRoute pm _ = clientWithRoute pm (Proxy :: Proxy api)
281-- | If you use a 'QueryParam' in one of your endpoints in your API,
287-- | If you use a 'QueryParam' in one of your endpoints in your API,
282-- the corresponding querying function will automatically take
288-- the corresponding querying function will automatically take
@@ -303,15 +309,15 @@ instance HasClient api => HasClient (Description desc :> api) where
303-- > -- then you can just use "getBooksBy" to query that endpoint.
309-- > -- then you can just use "getBooksBy" to query that endpoint.
304-- > -- 'getBooksBy Nothing' for all books
310-- > -- 'getBooksBy Nothing' for all books
305-- > -- 'getBooksBy (Just "Isaac Asimov")' to get all books by Isaac Asimov
311-- > -- 'getBooksBy (Just "Isaac Asimov")' to get all books by Isaac Asimov
306−instance (KnownSymbol sym, ToHttpApiData a, HasClient api)
312+instance (KnownSymbol sym, ToHttpApiData a, HasClient m api)
307− => HasClient (QueryParam sym a :> api) where
313+ => HasClient m (QueryParam sym a :> api) where
309 type Client m (QueryParam sym a :> api) =
315 type Client m (QueryParam sym a :> api) =
310 Maybe a -> Client m api
316 Maybe a -> Client m api
312 -- if mparam = Nothing, we don't add it to the query string
318 -- if mparam = Nothing, we don't add it to the query string
313− clientWithRoute Proxy req mparam =
319+ clientWithRoute pm Proxy req mparam =
314− clientWithRoute (Proxy :: Proxy api)
320+ clientWithRoute pm (Proxy :: Proxy api)
315 (maybe req
321 (maybe req
316 (flip (appendToQueryString pname) req . Just)
322 (flip (appendToQueryString pname) req . Just)
317 mparamText
323 mparamText
@@ -348,14 +354,14 @@ instance (KnownSymbol sym, ToHttpApiData a, HasClient api)
348-- > -- 'getBooksBy []' for all books
354-- > -- 'getBooksBy []' for all books
349-- > -- 'getBooksBy ["Isaac Asimov", "Robert A. Heinlein"]'
355-- > -- 'getBooksBy ["Isaac Asimov", "Robert A. Heinlein"]'
350-- > -- to get all books by Asimov and Heinlein
356-- > -- to get all books by Asimov and Heinlein
351−instance (KnownSymbol sym, ToHttpApiData a, HasClient api)
357+instance (KnownSymbol sym, ToHttpApiData a, HasClient m api)
352− => HasClient (QueryParams sym a :> api) where
358+ => HasClient m (QueryParams sym a :> api) where
354 type Client m (QueryParams sym a :> api) =
360 type Client m (QueryParams sym a :> api) =
355 [a] -> Client m api
361 [a] -> Client m api
357− clientWithRoute Proxy req paramlist =
363+ clientWithRoute pm Proxy req paramlist =
358− clientWithRoute (Proxy :: Proxy api)
364+ clientWithRoute pm (Proxy :: Proxy api)
359 (foldl' (\ req' -> maybe req' (flip (appendToQueryString pname) req' . Just))
365 (foldl' (\ req' -> maybe req' (flip (appendToQueryString pname) req' . Just))
361 paramlist'
367 paramlist'
@@ -386,14 +392,14 @@ instance (KnownSymbol sym, ToHttpApiData a, HasClient api)
386-- > -- then you can just use "getBooks" to query that endpoint.
392-- > -- then you can just use "getBooks" to query that endpoint.
387-- > -- 'getBooksBy False' for all books
393-- > -- 'getBooksBy False' for all books
388-- > -- 'getBooksBy True' to only get _already published_ books
394-- > -- 'getBooksBy True' to only get _already published_ books
389−instance (KnownSymbol sym, HasClient api)
395+instance (KnownSymbol sym, HasClient m api)
390− => HasClient (QueryFlag sym :> api) where
396+ => HasClient m (QueryFlag sym :> api) where
392 type Client m (QueryFlag sym :> api) =
398 type Client m (QueryFlag sym :> api) =
393 Bool -> Client m api
399 Bool -> Client m api
395− clientWithRoute Proxy req flag =
401+ clientWithRoute pm Proxy req flag =
396− clientWithRoute (Proxy :: Proxy api)
402+ clientWithRoute pm (Proxy :: Proxy api)
398 then appendToQueryString paramname Nothing req
404 then appendToQueryString paramname Nothing req
@@ -404,12 +410,13 @@ instance (KnownSymbol sym, HasClient api)
405-- | Pick a 'Method' and specify where the server you want to query is. You get
411-- | Pick a 'Method' and specify where the server you want to query is. You get
406-- back the full `Response`.
412-- back the full `Response`.
413+instance (RunClient m NoContent (Int, ByteString, MediaType, [HTTP.Header], Response ByteString))
407−instance HasClient Raw where
414+ => HasClient m Raw where
408 type Client m Raw
415 type Client m Raw
409 = H.Method -> m (Int, ByteString, MediaType, [HTTP.Header], Response ByteString)
416 = H.Method -> m (Int, ByteString, MediaType, [HTTP.Header], Response ByteString)
411− clientWithRoute :: Proxy Raw -> Req -> Client Raw
418+ clientWithRoute :: Proxy m -> Proxy Raw -> Req -> Client m Raw
412− clientWithRoute Proxy req httpMethod = do
419+ clientWithRoute pm Proxy req httpMethod = do
413 runRequest (Proxy :: Proxy NoContent) httpMethod req
420 runRequest (Proxy :: Proxy NoContent) httpMethod req
415-- | If you use a 'ReqBody' in one of your endpoints in your API,
422-- | If you use a 'ReqBody' in one of your endpoints in your API,
@@ -430,14 +437,14 @@ instance HasClient Raw where
430-- > addBook :: Book -> ClientM Book
437-- > addBook :: Book -> ClientM Book
431-- > addBook = client myApi
438-- > addBook = client myApi
432-- > -- then you can just use "addBook" to query that endpoint
439-- > -- then you can just use "addBook" to query that endpoint
433−instance (MimeRender ct a, HasClient api)
440+instance (MimeRender ct a, HasClient m api)
434− => HasClient (ReqBody (ct ': cts) a :> api) where
441+ => HasClient m (ReqBody (ct ': cts) a :> api) where
436 type Client m (ReqBody (ct ': cts) a :> api) =
443 type Client m (ReqBody (ct ': cts) a :> api) =
437 a -> Client m api
444 a -> Client m api
439− clientWithRoute Proxy req body =
446+ clientWithRoute pm Proxy req body =
440− clientWithRoute (Proxy :: Proxy api)
447+ clientWithRoute pm (Proxy :: Proxy api)
441 (let ctProxy = Proxy :: Proxy ct
448 (let ctProxy = Proxy :: Proxy ct
442 in setReqBodyLBS (mimeRender ctProxy body)
449 in setReqBodyLBS (mimeRender ctProxy body)
443 -- We use first contentType from the Accept list
450 -- We use first contentType from the Accept list
@@ -446,54 +453,54 @@ instance (MimeRender ct a, HasClient api)
448-- | Make the querying function append @path@ to the request path.
455-- | Make the querying function append @path@ to the request path.
449−instance (KnownSymbol path, HasClient api) => HasClient (path :> api) where
456+instance (KnownSymbol path, HasClient m api) => HasClient m (path :> api) where
450 type Client m (path :> api) = Client m api
457 type Client m (path :> api) = Client m api
452− clientWithRoute Proxy req =
459+ clientWithRoute pm Proxy req =
453− clientWithRoute (Proxy :: Proxy api)
460+ clientWithRoute pm (Proxy :: Proxy api)
454 (appendToPath p req)
461 (appendToPath p req)
456 where p = symbolVal (Proxy :: Proxy path)
463 where p = symbolVal (Proxy :: Proxy path)
458−instance HasClient api => HasClient (Vault :> api) where
465+instance HasClient m api => HasClient m (Vault :> api) where
459 type Client m (Vault :> api) = Client m api
466 type Client m (Vault :> api) = Client m api
461− clientWithRoute Proxy req =
468+ clientWithRoute pm Proxy req =
462− clientWithRoute (Proxy :: Proxy api) req
469+ clientWithRoute pm (Proxy :: Proxy api) req
464−instance HasClient api => HasClient (RemoteHost :> api) where
471+instance HasClient m api => HasClient m (RemoteHost :> api) where
465 type Client m (RemoteHost :> api) = Client m api
472 type Client m (RemoteHost :> api) = Client m api
467− clientWithRoute Proxy req =
474+ clientWithRoute pm Proxy req =
468− clientWithRoute (Proxy :: Proxy api) req
475+ clientWithRoute pm (Proxy :: Proxy api) req
470−instance HasClient api => HasClient (IsSecure :> api) where
477+instance HasClient m api => HasClient m (IsSecure :> api) where
471 type Client m (IsSecure :> api) = Client m api
478 type Client m (IsSecure :> api) = Client m api
473− clientWithRoute Proxy req =
480+ clientWithRoute pm Proxy req =
474− clientWithRoute (Proxy :: Proxy api) req
481+ clientWithRoute pm (Proxy :: Proxy api) req
476−instance HasClient subapi =>
483+instance HasClient m subapi =>
477− HasClient (WithNamedContext name context subapi) where
484+ HasClient m (WithNamedContext name context subapi) where
479 type Client m (WithNamedContext name context subapi) = Client m subapi
486 type Client m (WithNamedContext name context subapi) = Client m subapi
480− clientWithRoute Proxy = clientWithRoute (Proxy :: Proxy subapi)
487+ clientWithRoute pm Proxy = clientWithRoute pm (Proxy :: Proxy subapi)
482−instance ( HasClient api
489+instance ( HasClient m api
483− ) => HasClient (AuthProtect tag :> api) where
490+ ) => HasClient m (AuthProtect tag :> api) where
484 type Client m (AuthProtect tag :> api)
491 type Client m (AuthProtect tag :> api)
485 = AuthenticateReq (AuthProtect tag) -> Client m api
492 = AuthenticateReq (AuthProtect tag) -> Client m api
487− clientWithRoute Proxy req (AuthenticateReq (val,func)) =
494+ clientWithRoute pm Proxy req (AuthenticateReq (val,func)) =
488− clientWithRoute (Proxy :: Proxy api) (func val req)
495+ clientWithRoute pm (Proxy :: Proxy api) (func val req)
490-- * Basic Authentication
497-- * Basic Authentication
492−instance HasClient api => HasClient (BasicAuth realm usr :> api) where
499+instance HasClient m api => HasClient m (BasicAuth realm usr :> api) where
493 type Client m (BasicAuth realm usr :> api) = BasicAuthData -> Client m api
500 type Client m (BasicAuth realm usr :> api) = BasicAuthData -> Client m api
495− clientWithRoute Proxy req val =
502+ clientWithRoute pm Proxy req val =
496− clientWithRoute (Proxy :: Proxy api) (basicAuthReq val req)
503+ clientWithRoute pm (Proxy :: Proxy api) (basicAuthReq val req)
499{- Note [Non-Empty Content Types]
506{- Note [Non-Empty Content Types]