+ let l = [ "method" .= method, "params" .= params, "id" .= id ]
+ in case version of
+ JsonRpcV1 -> object l
+ JsonRpcV2 -> object $ ("jsonrpc" .= toJSON ("2.0" :: ByteString)):l
+
+data JsonRpcNotification = JsonRpcNotification
+ { jrpcNtfVersion :: JsonRpcVersion
+ , jrpcNtfMethod :: ByteString
+ , jrpcNtfParams :: [ByteString]
+ } deriving (Show)
+instance ToJSON JsonRpcNotification where
+ toJSON (JsonRpcNotification version method params) =
+ let l = [ "method" .= method, "params" .= params ]