fca59556dd
Move `HasServer (NamedRoutes routes)` instance The instance has been moved to `Servant.Server.Internal`, as the instances for other combinators. It is necessary so that the instance can be re-exported from `Servant.Server` without circular imports. Otherwise, users have to import `Servant.Server.Generic` manually ; forgetting to do so will produce confusing error messages about the missing instance. Move `HasClient (NamedRoutes routes)` instance Moved so that the instance is made available when importing `Servant.Client`, avoiding possibly confusing errors when `Servant.Client.Generic` isn't imported. |
||
---|---|---|
.. | ||
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.