From 178f05595a180dd418f9ea66b1472ec61a571121 Mon Sep 17 00:00:00 2001 From: David Turner Date: Tue, 16 May 2017 11:06:37 +0000 Subject: [PATCH] Better docs for EmptyAPIClient --- servant-client/src/Servant/Client.hs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/servant-client/src/Servant/Client.hs b/servant-client/src/Servant/Client.hs index cd68adc9..cf1ce9e7 100644 --- a/servant-client/src/Servant/Client.hs +++ b/servant-client/src/Servant/Client.hs @@ -89,9 +89,19 @@ instance (HasClient a, HasClient b) => HasClient (a :<|> b) where clientWithRoute (Proxy :: Proxy a) req :<|> clientWithRoute (Proxy :: Proxy b) req --- | TODO docs +-- | Singleton type representing a client for an empty API. data EmptyAPIClient = EmptyAPIClient +-- | The client for 'EmptyAPI' is simply 'EmptyAPIClient'. +-- +-- > type MyAPI = "books" :> Get '[JSON] [Book] -- GET /books +-- > :<|> "nothing" :> EmptyAPI +-- > +-- > myApi :: Proxy MyApi +-- > myApi = Proxy +-- > +-- > getAllBooks :: ClientM [Book] +-- > (getAllBooks :<|> EmptyAPIClient) = client myApi instance HasClient EmptyAPI where type Client EmptyAPI = EmptyAPIClient clientWithRoute Proxy _ = EmptyAPIClient