c55b778d8e
- WIP: pending http-api-data release - TODO: remove MIN_VERSION_http_types - There have been 3 major releases of http-types: - 0.10 change name of variable - 0.11 lowercase escaped URIs - 0.12 uppercase escaped URIs - It's easier for us to support only latest, migration from 0.9/0.10 to 0.12 is trivial for the downstream. 0.11 may cause semantic (non-type-error) breakage somewhere. Also allow lens-4.16, remove MIN_VERSION_http_types conditionals, and update `stack.yaml` |
||
---|---|---|
.. | ||
include | ||
src/Servant/Client | ||
test | ||
CHANGELOG.md | ||
LICENSE | ||
README.md | ||
servant-client-core.cabal | ||
Setup.hs |
servant-client-core
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:
- Define a
RunClient
instance for your datatype (call itMyMonad
) - Define a
ClientLike
instance. This will look like:
instance ClientLike (MyMonad a) (MyMonad a) where
mkClient = id
- 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 module.