Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
module Servant.JsonRpc
Orphan instances
(RunClient m, HasClient m api) => HasClient m (RawJsonRpc api) Source # | The |
type Client m (RawJsonRpc api) :: Type # 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 # | |
type Client m (JsonRpcNotification method p) :: Type # 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 # | |