Safe Haskell | None |
---|---|
Language | Haskell98 |
Simple JSON-RPC stuff, and JSON helper functions
- type RequestId = String
- data Request a = Request {
- requestMethod :: String
- requestParams :: [a]
- requestId :: RequestId
- data Response = Response {}
- data Notification a = Notification {
- notifMethod :: String
- notifParams :: [a]
- encodeRequest :: JSON a => Request a -> JSValue
- encodeNotification :: JSON a => Notification a -> JSValue
- decodeResponse :: JSValue -> Maybe Response
- jsString :: String -> JSValue
- jsNumber :: Int -> JSValue
- myReadJSON :: JSON a => JSValue -> Maybe a
- mbJSObject :: JSValue -> Maybe (JSObject JSValue)
- eiShowJSON :: (JSON a, JSON b) => Either a b -> JSValue
- newtype BS = BS {
- unBS :: ByteString
JSON-RPC
Request | |
|
data Notification a Source #
Notification | |
|
Show a => Show (Notification a) Source # | |
encodeNotification :: JSON a => Notification a -> JSValue Source #
misc helper functions
JSON parsing for special types
JSON instances
Unfortunately, Text.JSON already have a ByteString instance, which is different from what we need; hence this newtype
BS | |
|