servant-jsonrpc-client-1.1.0: Generate JSON-RPC servant clients

Safe HaskellNone
LanguageHaskell2010

Servant.Client.JsonRpc

Contents

Description

This module provides support for generating JSON-RPC clients in the Servant framework.

type Mul = JsonRpc "mul" (Int, Int) String Int
mul :: (Int, Int) -> ClientM (JsonRpcResponse String Int)
mul = client $ Proxy @Mul

Note: This client implementation runs over HTTP and the semantics of HTTP remove the need for the message id.

Documentation

Orphan instances

(RunClient m, HasClient m api) => HasClient m (RawJsonRpc api) Source #

The RawJsonRpc construct is completely transparent to clients

Instance details

Associated Types

type Client m (RawJsonRpc api) :: Type #

Methods

clientWithRoute :: Proxy m -> Proxy (RawJsonRpc api) -> Request -> Client m (RawJsonRpc api) #

hoistClientMonad :: Proxy m -> Proxy (RawJsonRpc api) -> (forall x. mon x -> mon' x) -> Client mon (RawJsonRpc api) -> Client mon' (RawJsonRpc api) #

(RunClient m, KnownSymbol method, ToJSON p) => HasClient m (JsonRpcNotification method p) Source # 
Instance details

Associated Types

type Client m (JsonRpcNotification method p) :: Type #

Methods

clientWithRoute :: Proxy m -> Proxy (JsonRpcNotification method p) -> Request -> Client m (JsonRpcNotification method p) #

hoistClientMonad :: Proxy m -> Proxy (JsonRpcNotification method p) -> (forall x. mon x -> mon' x) -> Client mon (JsonRpcNotification method p) -> Client mon' (JsonRpcNotification method p) #

(RunClient m, KnownSymbol method, ToJSON p, FromJSON e, FromJSON r) => HasClient m (JsonRpc method p e r) Source # 
Instance details

Associated Types

type Client m (JsonRpc method p e r) :: Type #

Methods

clientWithRoute :: Proxy m -> Proxy (JsonRpc method p e r) -> Request -> Client m (JsonRpc method p e r) #

hoistClientMonad :: Proxy m -> Proxy (JsonRpc method p e r) -> (forall x. mon x -> mon' x) -> Client mon (JsonRpc method p e r) -> Client mon' (JsonRpc method p e r) #