@@ -53,17 +53,16 @@ import Servant.Common.Req
5353-- > getAllBooks :: BaseUrl -> EitherT String IO [Book]
5454-- > postNewBook :: Book -> BaseUrl -> EitherT String IO Book
5555-- > (getAllBooks :<|> postNewBook) = client myApi
56−client :: HasClient (Canonicalize layout) => Proxy layout -> Client layout
57−client p = clientWithRoute (canonicalize p) defReq
56+client :: HasClient layout => Proxy layout -> Client layout
57+client p = clientWithRoute p defReq
5858
5959-- | This class lets us define how each API combinator
6060-- influences the creation of an HTTP request. It's mostly
6161-- an internal class, you can just use 'client'.
6262class HasClient layout where
63− type Client' layout :: *
64− clientWithRoute :: Proxy layout -> Req -> Client' layout
63+ type Client layout :: *
64+ clientWithRoute :: Proxy layout -> Req -> Client layout
6565
66−type Client layout = Client' (Canonicalize layout)
6766
6867-- | A client querying function for @a ':<|>' b@ will actually hand you
6968-- one function for querying @a@ and another one for querying @b@,
@@ -79,7 +78,7 @@ type Client layout = Client' (Canonicalize layout)
7978-- > postNewBook :: Book -> BaseUrl -> EitherT String IO Book
8079-- > (getAllBooks :<|> postNewBook) = client myApi
8180instance (HasClient a, HasClient b) => HasClient (a :<|> b) where
82− type Client' (a :<|> b) = Client' a :<|> Client' b
81+ type Client (a :<|> b) = Client a :<|> Client b
8382 clientWithRoute Proxy req =
8483 clientWithRoute (Proxy :: Proxy a) req :<|>
8584 clientWithRoute (Proxy :: Proxy b) req
@@ -106,8 +105,8 @@ instance (HasClient a, HasClient b) => HasClient (a :<|> b) where
106105instance (KnownSymbol capture, ToText a, HasClient sublayout)
107106 => HasClient (Capture capture a :> sublayout) where
108107
109− type Client' (Capture capture a :> sublayout) =
110− a -> Client' sublayout
108+ type Client (Capture capture a :> sublayout) =
109+ a -> Client sublayout
111110
112111 clientWithRoute Proxy req val =
113112 clientWithRoute (Proxy :: Proxy sublayout) $
@@ -120,7 +119,7 @@ instance (KnownSymbol capture, ToText a, HasClient sublayout)
120119-- will just require an argument that specifies the scheme, host
121120-- and port to send the request to.
122121instance HasClient Delete where
123− type Client' Delete = BaseUrl -> EitherT ServantError IO ()
122+ type Client Delete = BaseUrl -> EitherT ServantError IO ()
124123
125124 clientWithRoute Proxy req host =
126125 void $ performRequest H.methodDelete req (`elem` [200, 202, 204]) host
@@ -134,7 +133,7 @@ instance
134133 {-# OVERLAPPABLE #-}
135134#endif
136135 (MimeUnrender ct result) => HasClient (Get (ct ': cts) result) where
137− type Client' (Get (ct ': cts) result) = BaseUrl -> EitherT ServantError IO result
136+ type Client (Get (ct ': cts) result) = BaseUrl -> EitherT ServantError IO result
138137 clientWithRoute Proxy req host =
139138 snd <$> performRequestCT (Proxy :: Proxy ct) H.methodGet req [200, 203] host
140139
@@ -145,7 +144,7 @@ instance
145144 {-# OVERLAPPING #-}
146145#endif
147146 HasClient (Get (ct ': cts) ()) where
148− type Client' (Get (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
147+ type Client (Get (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
149148 clientWithRoute Proxy req host =
150149 performRequestNoBody H.methodGet req [204] host
151150
@@ -157,7 +156,7 @@ instance
157156#endif
158157 ( MimeUnrender ct a, BuildHeadersTo ls
159158 ) => HasClient (Get (ct ': cts) (Headers ls a)) where
160− type Client' (Get (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
159+ type Client (Get (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
161160 clientWithRoute Proxy req host = do
162161 (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodGet req [200, 203, 204] host
163162 return $ Headers { getResponse = resp
@@ -192,8 +191,8 @@ instance
192191instance (KnownSymbol sym, ToText a, HasClient sublayout)
193192 => HasClient (Header sym a :> sublayout) where
194193
195− type Client' (Header sym a :> sublayout) =
196− Maybe a -> Client' sublayout
194+ type Client (Header sym a :> sublayout) =
195+ Maybe a -> Client sublayout
197196
198197 clientWithRoute Proxy req mval =
199198 clientWithRoute (Proxy :: Proxy sublayout) $
@@ -210,7 +209,7 @@ instance
210209 {-# OVERLAPPABLE #-}
211210#endif
212211 (MimeUnrender ct a) => HasClient (Post (ct ': cts) a) where
213− type Client' (Post (ct ': cts) a) = BaseUrl -> EitherT ServantError IO a
212+ type Client (Post (ct ': cts) a) = BaseUrl -> EitherT ServantError IO a
214213
215214 clientWithRoute Proxy req uri =
216215 snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPost req [200,201] uri
@@ -222,7 +221,7 @@ instance
222221 {-# OVERLAPPING #-}
223222#endif
224223 HasClient (Post (ct ': cts) ()) where
225− type Client' (Post (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
224+ type Client (Post (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
226225 clientWithRoute Proxy req host =
227226 void $ performRequestNoBody H.methodPost req [204] host
228227
@@ -234,7 +233,7 @@ instance
234233#endif
235234 ( MimeUnrender ct a, BuildHeadersTo ls
236235 ) => HasClient (Post (ct ': cts) (Headers ls a)) where
237− type Client' (Post (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
236+ type Client (Post (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
238237 clientWithRoute Proxy req host = do
239238 (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodPost req [200, 201] host
240239 return $ Headers { getResponse = resp
@@ -250,7 +249,7 @@ instance
250249 {-# OVERLAPPABLE #-}
251250#endif
252251 (MimeUnrender ct a) => HasClient (Put (ct ': cts) a) where
253− type Client' (Put (ct ': cts) a) = BaseUrl -> EitherT ServantError IO a
252+ type Client (Put (ct ': cts) a) = BaseUrl -> EitherT ServantError IO a
254253
255254 clientWithRoute Proxy req host =
256255 snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPut req [200,201] host
@@ -262,7 +261,7 @@ instance
262261 {-# OVERLAPPING #-}
263262#endif
264263 HasClient (Put (ct ': cts) ()) where
265− type Client' (Put (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
264+ type Client (Put (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
266265 clientWithRoute Proxy req host =
267266 void $ performRequestNoBody H.methodPut req [204] host
268267
@@ -274,7 +273,7 @@ instance
274273#endif
275274 ( MimeUnrender ct a, BuildHeadersTo ls
276275 ) => HasClient (Put (ct ': cts) (Headers ls a)) where
277− type Client' (Put (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
276+ type Client (Put (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
278277 clientWithRoute Proxy req host = do
279278 (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodPut req [200, 201] host
280279 return $ Headers { getResponse = resp
@@ -290,7 +289,7 @@ instance
290289 {-# OVERLAPPABLE #-}
291290#endif
292291 (MimeUnrender ct a) => HasClient (Patch (ct ': cts) a) where
293− type Client' (Patch (ct ': cts) a) = BaseUrl -> EitherT ServantError IO a
292+ type Client (Patch (ct ': cts) a) = BaseUrl -> EitherT ServantError IO a
294293
295294 clientWithRoute Proxy req host =
296295 snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPatch req [200,201] host
@@ -302,7 +301,7 @@ instance
302301 {-# OVERLAPPING #-}
303302#endif
304303 HasClient (Patch (ct ': cts) ()) where
305− type Client' (Patch (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
304+ type Client (Patch (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
306305 clientWithRoute Proxy req host =
307306 void $ performRequestNoBody H.methodPatch req [204] host
308307
@@ -314,7 +313,7 @@ instance
314313#endif
315314 ( MimeUnrender ct a, BuildHeadersTo ls
316315 ) => HasClient (Patch (ct ': cts) (Headers ls a)) where
317− type Client' (Patch (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
316+ type Client (Patch (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
318317 clientWithRoute Proxy req host = do
319318 (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodPatch req [200, 201, 204] host
320319 return $ Headers { getResponse = resp
@@ -349,8 +348,8 @@ instance
349348instance (KnownSymbol sym, ToText a, HasClient sublayout)
350349 => HasClient (QueryParam sym a :> sublayout) where
351350
352− type Client' (QueryParam sym a :> sublayout) =
353− Maybe a -> Client' sublayout
351+ type Client (QueryParam sym a :> sublayout) =
352+ Maybe a -> Client sublayout
354353
355354 -- if mparam = Nothing, we don't add it to the query string
356355 clientWithRoute Proxy req mparam =
@@ -391,8 +390,8 @@ instance (KnownSymbol sym, ToText a, HasClient sublayout)
391390instance (KnownSymbol sym, ToText a, HasClient sublayout)
392391 => HasClient (QueryParams sym a :> sublayout) where
393392
394− type Client' (QueryParams sym a :> sublayout) =
395− [a] -> Client' sublayout
393+ type Client (QueryParams sym a :> sublayout) =
394+ [a] -> Client sublayout
396395
397396 clientWithRoute Proxy req paramlist =
398397 clientWithRoute (Proxy :: Proxy sublayout) $
@@ -426,8 +425,8 @@ instance (KnownSymbol sym, ToText a, HasClient sublayout)
426425instance (KnownSymbol sym, HasClient sublayout)
427426 => HasClient (QueryFlag sym :> sublayout) where
428427
429− type Client' (QueryFlag sym :> sublayout) =
430− Bool -> Client' sublayout
428+ type Client (QueryFlag sym :> sublayout) =
429+ Bool -> Client sublayout
431430
432431 clientWithRoute Proxy req flag =
433432 clientWithRoute (Proxy :: Proxy sublayout) $
@@ -465,8 +464,8 @@ instance (KnownSymbol sym, HasClient sublayout)
465464instance (KnownSymbol sym, ToText a, HasClient sublayout)
466465 => HasClient (MatrixParam sym a :> sublayout) where
467466
468− type Client' (MatrixParam sym a :> sublayout) =
469− Maybe a -> Client' sublayout
467+ type Client (MatrixParam sym a :> sublayout) =
468+ Maybe a -> Client sublayout
470469
471470 -- if mparam = Nothing, we don't add it to the query string
472471 clientWithRoute Proxy req mparam =
@@ -506,8 +505,8 @@ instance (KnownSymbol sym, ToText a, HasClient sublayout)
506505instance (KnownSymbol sym, ToText a, HasClient sublayout)
507506 => HasClient (MatrixParams sym a :> sublayout) where
508507
509− type Client' (MatrixParams sym a :> sublayout) =
510− [a] -> Client' sublayout
508+ type Client (MatrixParams sym a :> sublayout) =
509+ [a] -> Client sublayout
511510
512511 clientWithRoute Proxy req paramlist =
513512 clientWithRoute (Proxy :: Proxy sublayout) $
@@ -541,8 +540,8 @@ instance (KnownSymbol sym, ToText a, HasClient sublayout)
541540instance (KnownSymbol sym, HasClient sublayout)
542541 => HasClient (MatrixFlag sym :> sublayout) where
543542
544− type Client' (MatrixFlag sym :> sublayout) =
545− Bool -> Client' sublayout
543+ type Client (MatrixFlag sym :> sublayout) =
544+ Bool -> Client sublayout
546545
547546 clientWithRoute Proxy req flag =
548547 clientWithRoute (Proxy :: Proxy sublayout) $
@@ -555,9 +554,9 @@ instance (KnownSymbol sym, HasClient sublayout)
555554-- | Pick a 'Method' and specify where the server you want to query is. You get
556555-- back the full `Response`.
557556instance HasClient Raw where
558− type Client' Raw = H.Method -> BaseUrl -> EitherT ServantError IO (Int, ByteString, MediaType, [HTTP.Header], Response ByteString)
557+ type Client Raw = H.Method -> BaseUrl -> EitherT ServantError IO (Int, ByteString, MediaType, [HTTP.Header], Response ByteString)
559558
560− clientWithRoute :: Proxy Raw -> Req -> Client' Raw
559+ clientWithRoute :: Proxy Raw -> Req -> Client Raw
561560 clientWithRoute Proxy req httpMethod host = do
562561 performRequest httpMethod req (const True) host
563562
@@ -582,8 +581,8 @@ instance HasClient Raw where
582581instance (MimeRender ct a, HasClient sublayout)
583582 => HasClient (ReqBody (ct ': cts) a :> sublayout) where
584583
585− type Client' (ReqBody (ct ': cts) a :> sublayout) =
586− a -> Client' sublayout
584+ type Client (ReqBody (ct ': cts) a :> sublayout) =
585+ a -> Client sublayout
587586
588587 clientWithRoute Proxy req body =
589588 clientWithRoute (Proxy :: Proxy sublayout) $ do
@@ -592,7 +591,7 @@ instance (MimeRender ct a, HasClient sublayout)
592591
593592-- | Make the querying function append @path@ to the request path.
594593instance (KnownSymbol path, HasClient sublayout) => HasClient (path :> sublayout) where
595− type Client' (path :> sublayout) = Client' sublayout
594+ type Client (path :> sublayout) = Client sublayout
596595
597596 clientWithRoute Proxy req =
598597 clientWithRoute (Proxy :: Proxy sublayout) $