Copyright | Alexander Krupenkin 2016-2018 |
---|---|
License | BSD3 |
Maintainer | mail@akru.me |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Tiny JSON-RPC 2.0 client. Functions for implementing the client side of JSON-RPC 2.0. See http://www.jsonrpc.org/specification.
- data JsonRpcException
- data RpcError = RpcError {}
- type MethodName = Text
- type ServerUri = String
- class (MonadIO m, MonadThrow m, MonadReader Config m) => Remote m a | a -> m
- remote :: Remote m a => MethodName -> a
Documentation
data JsonRpcException Source #
JSON-RPC error message
type MethodName = Text Source #
Name of called method.
class (MonadIO m, MonadThrow m, MonadReader Config m) => Remote m a | a -> m Source #
Typeclass for JSON-RPC monad base.
If you have monad with MonadIO
, MonadThrow
and MonadReader
instances,
it can be used as base for JSON-RPC calls.
Example:
newtype MyMonad a = ... instance Remote MyMonad (Mymonad a) foo :: Int -> Bool -> Mymonad Text foo = remote "foo"
remote :: Remote m a => MethodName -> a Source #
Remote call of JSON-RPC method.
Arguments of function are stored into params
request array.
Example:
myMethod :: Int -> Bool -> m String myMethod = remote "myMethod"