servant-client-core

Core functionality and class for client function generation for servant APIs

http://haskell-servant.readthedocs.org/

Version on this page:0.13@rev:1
LTS Haskell 22.14:0.20@rev:3
Stackage Nightly 2024-03-28:0.20@rev:3
Latest on Hackage:0.20@rev:3

See all snapshots servant-client-core appears in

BSD-3-Clause licensed by Servant Contributors
Maintained by [email protected]
This version can be pinned in stack with:servant-client-core-0.13@sha256:cbb6f6fb87db9f009f94defd27e61558048e971f0d0c1f60bd9499412e60b37f,3411

servant-client-core

servant

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:
instance ClientLike (MyMonad a) (MyMonad a) where
  mkClient = id
  1. 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.

Changes

The latest version of this document is on GitHub. Changelog for servant package contains significant entries for all core packages.

0.13

  • Streaming endpoint support. (#836)
  • servant Add Servant.API.Modifiers (#873)

0.12

  • First version. Factored out of servant-client all the functionality that was independent of the http-client backend.