Readme for servant-client-core

This commit is contained in:
Julian K. Arni 2017-09-13 12:50:37 -04:00
parent e8b9814168
commit 257c3d4081
2 changed files with 27 additions and 1 deletions

View File

@ -3,3 +3,28 @@
![servant](https://raw.githubusercontent.com/haskell-servant/servant/master/servant.png)
HTTP-client-agnostic client functions for servant APIs.
This library should mainly be of interest to backend- and combinator-writers.
## For backend-writers
If you are creating a new backend, you'll need to:
1) Define a `RunClient` instance for your datatype (call it 'MyMonad')
2) Define a `ClientLike` instance. This will look like:
``` haskell
instance ClientLike (MyMonad a) (MyMonad a) where
mkClient = id
```
3) Re-export the module Servant.Client.Core.Reexport so that your end-users
can be blissfully unaware of 'servant-client-core', and so each
backend-package comes closer to the warm hearth of the drop-in-replacement
equivalence class.
## For combinator-writers
You'l need to define a new `HasClient` instance for your combinator. There are
plenty of examples to guide you in the
[HasClient](src/Servant/Client/Core/Internal/HasClient.hs) module.

View File

@ -2,7 +2,8 @@ name: servant-client-core
version: 0.11
synopsis: Core functionality and class for client function generation for servant APIs
description:
This library provides a class
This library provides backend-agnostic generation of client functions. For
more information, see the README.
license: BSD3
license-file: LICENSE
author: Servant Contributors