File: README.md

package info (click to toggle)
haskell-servant-client-core 0.20.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 216 kB
  • sloc: haskell: 1,740; makefile: 3
file content (30 lines) | stat: -rw-r--r-- 993 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# servant-client-core

![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'll 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.