on ci-fix-followups help sign in
30 lines 993 B history raw
1# servant-client-core
3![servant](https://raw.githubusercontent.com/haskell-servant/servant/master/servant.png)
5HTTP-client-agnostic client functions for servant APIs.
7This library should mainly be of interest to backend- and combinator-writers.
9## For backend-writers
11If you are creating a new backend, you'll need to:
131. Define a `RunClient` instance for your datatype (call it `MyMonad`)
142. Define a `ClientLike` instance. This will look like:
16``` haskell
17instance ClientLike (MyMonad a) (MyMonad a) where
18 mkClient = id
19```
213. 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.
26## For combinator-writers
28You'll need to define a new `HasClient` instance for your combinator. There are
29plenty of examples to guide you in the
30[HasClient](src/Servant/Client/Core/Internal/HasClient.hs) module.