git.iko.soy/typeable/servant
on master help sign in
Better docs for EmptyAPIClient
commit178f05595a180dd418f9ea66b1472ec61a571121 authorDavid Turner <dave.c.turner@gmail.com> dateTue 16 May 2017, 11:06 (9 years ago) parente73f00b
1 file changed+11−1
servant-client/src/Servant/Client.hs+11−1
servant-client/src/Servant/Client.hs+11−1
@@ -89,9 +89,19 @@ instance (HasClient a, HasClient b) => HasClient (a :<|> b) where
8989 clientWithRoute (Proxy :: Proxy a) req :<|>
9090 clientWithRoute (Proxy :: Proxy b) req
9191
92−-- | TODO docs
92+-- | Singleton type representing a client for an empty API.
9393data EmptyAPIClient = EmptyAPIClient
9494
95+-- | The client for 'EmptyAPI' is simply 'EmptyAPIClient'.
96+--
97+-- > type MyAPI = "books" :> Get '[JSON] [Book] -- GET /books
98+-- > :<|> "nothing" :> EmptyAPI
99+-- >
100+-- > myApi :: Proxy MyApi
101+-- > myApi = Proxy
102+-- >
103+-- > getAllBooks :: ClientM [Book]
104+-- > (getAllBooks :<|> EmptyAPIClient) = client myApi
95105instance HasClient EmptyAPI where
96106 type Client EmptyAPI = EmptyAPIClient
97107 clientWithRoute Proxy _ = EmptyAPIClient