@@ -24,7 +24,7 @@ module Servant.Client
24 , ClientEnv (ClientEnv)
24 , ClientEnv (ClientEnv)
25 , mkAuthenticateReq
25 , mkAuthenticateReq
26 , ServantError(..)
26 , ServantError(..)
27− , EmptyAPIClient(..)
27+ , EmptyClient(..)
28 , module Servant.Common.BaseUrl
28 , module Servant.Common.BaseUrl
@@ -90,9 +90,9 @@ instance (HasClient a, HasClient b) => HasClient (a :<|> b) where
90 clientWithRoute (Proxy :: Proxy b) req
90 clientWithRoute (Proxy :: Proxy b) req
92-- | Singleton type representing a client for an empty API.
92-- | Singleton type representing a client for an empty API.
93−data EmptyAPIClient = EmptyAPIClient
93+data EmptyClient = EmptyClient deriving (Eq, Show, Bounded, Enum)
95−-- | The client for 'EmptyAPI' is simply 'EmptyAPIClient'.
95+-- | The client for 'EmptyAPI' is simply 'EmptyClient'.
97-- > type MyAPI = "books" :> Get '[JSON] [Book] -- GET /books
97-- > type MyAPI = "books" :> Get '[JSON] [Book] -- GET /books
98-- > :<|> "nothing" :> EmptyAPI
98-- > :<|> "nothing" :> EmptyAPI
@@ -101,10 +101,10 @@ data EmptyAPIClient = EmptyAPIClient
101-- > myApi = Proxy
101-- > myApi = Proxy
103-- > getAllBooks :: ClientM [Book]
103-- > getAllBooks :: ClientM [Book]
104−-- > (getAllBooks :<|> EmptyAPIClient) = client myApi
104+-- > (getAllBooks :<|> EmptyClient) = client myApi
105instance HasClient EmptyAPI where
105instance HasClient EmptyAPI where
106− type Client EmptyAPI = EmptyAPIClient
106+ type Client EmptyAPI = EmptyClient
107− clientWithRoute Proxy _ = EmptyAPIClient
107+ clientWithRoute Proxy _ = EmptyClient
109-- | If you use a 'Capture' in one of your endpoints in your API,
109-- | If you use a 'Capture' in one of your endpoints in your API,
110-- the corresponding querying function will automatically take
110-- the corresponding querying function will automatically take