git.iko.soy/typeable/servant
on master help sign in
Readme for servant-client-core
commit257c3d4081ccafab3dea551acc2871899a383be2 authorJulian K. Arni <jkarni@gmail.com> dateWed 13 Sep 2017, 12:50 (9 years ago) parente8b9814
2 files changed+27−1
servant-client-core/README.md+25 servant-client-core/servant-client-core.cabal+2−1
servant-client-core/README.md+25
@@ -3,3 +3,28 @@
33![servant](https://raw.githubusercontent.com/haskell-servant/servant/master/servant.png)
44
55HTTP-client-agnostic client functions for servant APIs.
6+
7+This library should mainly be of interest to backend- and combinator-writers.
8+
9+## For backend-writers
10+
11+If you are creating a new backend, you'll need to:
12+
13+ 1) Define a `RunClient` instance for your datatype (call it 'MyMonad')
14+ 2) Define a `ClientLike` instance. This will look like:
15+
16+``` haskell
17+instance ClientLike (MyMonad a) (MyMonad a) where
18+ mkClient = id
19+```
20+
21+ 3) Re-export the module Servant.Client.Core.Reexport so that your end-users
22+ can be blissfully unaware of 'servant-client-core', and so each
23+ backend-package comes closer to the warm hearth of the drop-in-replacement
24+ equivalence class.
25+
26+## For combinator-writers
27+
28+You'l need to define a new `HasClient` instance for your combinator. There are
29+plenty of examples to guide you in the
30+[HasClient](src/Servant/Client/Core/Internal/HasClient.hs) module.
servant-client-core/servant-client-core.cabal+2−1
@@ -2,7 +2,8 @@ name: servant-client-core
22version: 0.11
33synopsis: Core functionality and class for client function generation for servant APIs
44description:
5− This library provides a class
5+ This library provides backend-agnostic generation of client functions. For
6+ more information, see the README.
67license: BSD3
78license-file: LICENSE
89author: Servant Contributors