Better docs for EmptyAPIClient
This commit is contained in:
parent
e73f00b333
commit
178f05595a
1 changed files with 11 additions and 1 deletions
|
@ -89,9 +89,19 @@ instance (HasClient a, HasClient b) => HasClient (a :<|> b) where
|
||||||
clientWithRoute (Proxy :: Proxy a) req :<|>
|
clientWithRoute (Proxy :: Proxy a) req :<|>
|
||||||
clientWithRoute (Proxy :: Proxy b) req
|
clientWithRoute (Proxy :: Proxy b) req
|
||||||
|
|
||||||
-- | TODO docs
|
-- | Singleton type representing a client for an empty API.
|
||||||
data EmptyAPIClient = EmptyAPIClient
|
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
|
instance HasClient EmptyAPI where
|
||||||
type Client EmptyAPI = EmptyAPIClient
|
type Client EmptyAPI = EmptyAPIClient
|
||||||
clientWithRoute Proxy _ = EmptyAPIClient
|
clientWithRoute Proxy _ = EmptyAPIClient
|
||||||
|
|
Loading…
Reference in a new issue