@@ -63,7 +63,7 @@ import Servant.Server
6363import Servant.Server.Experimental.Auth
6464
6565-- This declaration simply checks that all instances are in place.
66−_ = client (Proxy :: Proxy ClientM) comprehensiveAPI
66+_ = client inClientM comprehensiveAPI
6767
6868spec :: Spec
6969spec = describe "Servant.Client" $ do
@@ -147,7 +147,7 @@ getGet
147147 :<|> getMultiple
148148 :<|> getRespHeaders
149149 :<|> getDeleteContentType
150− :<|> EmptyClient = client (Proxy :: Proxy ClientM) api
150+ :<|> EmptyClient = client inClientM api
151151
152152server :: Application
153153server = serve api (
@@ -359,7 +359,7 @@ wrappedApiSpec = describe "error status codes" $ do
359359 test (WrappedApi api, desc) =
360360 it desc $ bracket (startWaiApp $ serveW api) endWaiApp $ \(_, baseUrl) -> do
361361 let getResponse :: SCR.ClientM ()
362− getResponse = client (Proxy :: Proxy ClientM) api
362+ getResponse = client inClientM api
363363 Left FailureResponse{..} <- runClientM getResponse (ClientEnv manager baseUrl)
364364 responseStatus `shouldBe` (HTTP.Status 500 "error message")
365365 in mapM_ test $
@@ -374,35 +374,35 @@ failSpec = beforeAll (startWaiApp failServer) $ afterAll endWaiApp $ do
374374
375375 context "client returns errors appropriately" $ do
376376 it "reports FailureResponse" $ \(_, baseUrl) -> do
377− let (_ :<|> getDeleteEmpty :<|> _) = client (Proxy :: Proxy ClientM) api
377+ let (_ :<|> getDeleteEmpty :<|> _) = client inClientM api
378378 Left res <- runClientM getDeleteEmpty (ClientEnv manager baseUrl)
379379 case res of
380380 FailureResponse _ (HTTP.Status 404 "Not Found") _ _ -> return ()
381381 _ -> fail $ "expected 404 response, but got " <> show res
382382
383383 it "reports DecodeFailure" $ \(_, baseUrl) -> do
384− let (_ :<|> _ :<|> getCapture :<|> _) = client (Proxy :: Proxy ClientM) api
384+ let (_ :<|> _ :<|> getCapture :<|> _) = client inClientM api
385385 Left res <- runClientM (getCapture "foo") (ClientEnv manager baseUrl)
386386 case res of
387387 DecodeFailure _ ("application/json") _ -> return ()
388388 _ -> fail $ "expected DecodeFailure, but got " <> show res
389389
390390 it "reports ConnectionError" $ \_ -> do
391− let (getGetWrongHost :<|> _) = client (Proxy :: Proxy ClientM) api
391+ let (getGetWrongHost :<|> _) = client inClientM api
392392 Left res <- runClientM getGetWrongHost (ClientEnv manager (BaseUrl Http "127.0.0.1" 19872 ""))
393393 case res of
394394 ConnectionError _ -> return ()
395395 _ -> fail $ "expected ConnectionError, but got " <> show res
396396
397397 it "reports UnsupportedContentType" $ \(_, baseUrl) -> do
398− let (getGet :<|> _ ) = client (Proxy :: Proxy ClientM) api
398+ let (getGet :<|> _ ) = client inClientM api
399399 Left res <- runClientM getGet (ClientEnv manager baseUrl)
400400 case res of
401401 UnsupportedContentType ("application/octet-stream") _ -> return ()
402402 _ -> fail $ "expected UnsupportedContentType, but got " <> show res
403403
404404 it "reports InvalidContentTypeHeader" $ \(_, baseUrl) -> do
405− let (_ :<|> _ :<|> _ :<|> _ :<|> getBody :<|> _) = client (Proxy :: Proxy ClientM) api
405+ let (_ :<|> _ :<|> _ :<|> _ :<|> getBody :<|> _) = client inClientM api
406406 Left res <- runClientM (getBody alice) (ClientEnv manager baseUrl)
407407 case res of
408408 InvalidContentTypeHeader "fooooo" _ -> return ()
@@ -418,14 +418,14 @@ basicAuthSpec = beforeAll (startWaiApp basicAuthServer) $ afterAll endWaiApp $ d
418418 context "Authentication works when requests are properly authenticated" $ do
419419
420420 it "Authenticates a BasicAuth protected server appropriately" $ \(_,baseUrl) -> do
421− let getBasic = client (Proxy :: Proxy ClientM) basicAuthAPI
421+ let getBasic = client inClientM basicAuthAPI
422422 let basicAuthData = BasicAuthData "servant" "server"
423423 (left show <$> runClientM (getBasic basicAuthData) (ClientEnv manager baseUrl)) `shouldReturn` Right alice
424424
425425 context "Authentication is rejected when requests are not authenticated properly" $ do
426426
427427 it "Authenticates a BasicAuth protected server appropriately" $ \(_,baseUrl) -> do
428− let getBasic = client (Proxy :: Proxy ClientM) basicAuthAPI
428+ let getBasic = client inClientM basicAuthAPI
429429 let basicAuthData = BasicAuthData "not" "password"
430430 Left FailureResponse{..} <- runClientM (getBasic basicAuthData) (ClientEnv manager baseUrl)
431431 responseStatus `shouldBe` HTTP.Status 403 "Forbidden"
@@ -435,14 +435,14 @@ genAuthSpec = beforeAll (startWaiApp genAuthServer) $ afterAll endWaiApp $ do
435435 context "Authentication works when requests are properly authenticated" $ do
436436
437437 it "Authenticates a AuthProtect protected server appropriately" $ \(_, baseUrl) -> do
438− let getProtected = client (Proxy :: Proxy ClientM) genAuthAPI
438+ let getProtected = client inClientM genAuthAPI
439439 let authRequest = mkAuthenticateReq () (\_ req -> SCR.addHeader "AuthHeader" ("cool" :: String) req)
440440 (left show <$> runClientM (getProtected authRequest) (ClientEnv manager baseUrl)) `shouldReturn` Right alice
441441
442442 context "Authentication is rejected when requests are not authenticated properly" $ do
443443
444444 it "Authenticates a AuthProtect protected server appropriately" $ \(_, baseUrl) -> do
445− let getProtected = client (Proxy :: Proxy ClientM) genAuthAPI
445+ let getProtected = client inClientM genAuthAPI
446446 let authRequest = mkAuthenticateReq () (\_ req -> SCR.addHeader "Wrong" ("header" :: String) req)
447447 Left FailureResponse{..} <- runClientM (getProtected authRequest) (ClientEnv manager baseUrl)
448448 responseStatus `shouldBe` (HTTP.Status 401 "Unauthorized")
@@ -451,11 +451,11 @@ genericClientSpec :: Spec
451451genericClientSpec = beforeAll (startWaiApp genericClientServer) $ afterAll endWaiApp $ do
452452 describe "Servant.Client.Generic" $ do
453453
454− let GenericClient{..} = mkClient (client (Proxy :: Proxy ClientM) (Proxy :: Proxy GenericClientAPI))
454+ let GenericClient{..} = mkClient (client inClientM (Proxy :: Proxy GenericClientAPI))
455455 NestedClient1{..} = mkNestedClient1 "example"
456456 NestedClient2{..} = mkNestedClient2 (Just 42)
457457
458− it "works for top-level client (Proxy :: Proxy ClientM) function" $ \(_, baseUrl) -> do
458+ it "works for top-level client inClientM function" $ \(_, baseUrl) -> do
459459 (left show <$> (runClientM (getSqr (Just 5)) (ClientEnv manager baseUrl))) `shouldReturn` Right 25
460460
461461 it "works for nested clients" $ \(_, baseUrl) -> do