Safe Haskell | Safe-Inferred |
---|---|
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 (RawJsonRpc ctype apiL), HasClient m (RawJsonRpc ctype apiR)) => HasClient m (RawJsonRpc ctype (apiL :<|> apiR)) Source # | The |
type Client m (RawJsonRpc ctype (apiL :<|> apiR)) # clientWithRoute :: Proxy m -> Proxy (RawJsonRpc ctype (apiL :<|> apiR)) -> Request -> Client m (RawJsonRpc ctype (apiL :<|> apiR)) # hoistClientMonad :: Proxy m -> Proxy (RawJsonRpc ctype (apiL :<|> apiR)) -> (forall x. mon x -> mon' x) -> Client mon (RawJsonRpc ctype (apiL :<|> apiR)) -> Client mon' (RawJsonRpc ctype (apiL :<|> apiR)) # | |
(RunClient m, KnownSymbol method, MimeRender ctype (Request p), MimeUnrender ctype (JsonRpcResponse e r)) => HasClient m (RawJsonRpc ctype (JsonRpc method p e r)) Source # | |
type Client m (RawJsonRpc ctype (JsonRpc method p e r)) # clientWithRoute :: Proxy m -> Proxy (RawJsonRpc ctype (JsonRpc method p e r)) -> Request -> Client m (RawJsonRpc ctype (JsonRpc method p e r)) # hoistClientMonad :: Proxy m -> Proxy (RawJsonRpc ctype (JsonRpc method p e r)) -> (forall x. mon x -> mon' x) -> Client mon (RawJsonRpc ctype (JsonRpc method p e r)) -> Client mon' (RawJsonRpc ctype (JsonRpc method p e r)) # | |
(RunClient m, KnownSymbol method, MimeRender ctype (Request p)) => HasClient m (RawJsonRpc ctype (JsonRpcNotification method p)) Source # | |
type Client m (RawJsonRpc ctype (JsonRpcNotification method p)) # clientWithRoute :: Proxy m -> Proxy (RawJsonRpc ctype (JsonRpcNotification method p)) -> Request -> Client m (RawJsonRpc ctype (JsonRpcNotification method p)) # hoistClientMonad :: Proxy m -> Proxy (RawJsonRpc ctype (JsonRpcNotification method p)) -> (forall x. mon x -> mon' x) -> Client mon (RawJsonRpc ctype (JsonRpcNotification method p)) -> Client mon' (RawJsonRpc ctype (JsonRpcNotification method p)) # |