Skip to content

Commit ef856a8

Browse files
committed
Cleanup
1 parent 0fc5117 commit ef856a8

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
json-rpc-server
22
===============
3-
[![Build Status](https://travis-ci.org/grayjay/json-rpc-server.svg?branch=master)](https://travis-ci.org/grayjay/json-rpc-server)
3+
[![Hackage](https://img.shields.io/hackage/v/json-rpc-server.svg?style=flat)](https://hackage.haskell.org/package/json-rpc-server) [![Build Status](https://travis-ci.org/grayjay/json-rpc-server.svg?branch=master)](https://travis-ci.org/grayjay/json-rpc-server)
44

5-
An implementation of the server side of JSON-RPC 2.0. See <http://www.jsonrpc.org/specification>. This library uses ByteString for input and output, leaving the choice of transport up to the user. The documentation is on Hackage: <http://hackage.haskell.org/package/json-rpc-server>.
5+
An implementation of the server side of JSON-RPC 2.0. See <http://www.jsonrpc.org/specification>. json-rpc-server uses ByteString for input and output, leaving the choice of transport up to the user. It can be used with [json-rpc-client](http://hackage.haskell.org/package/json-rpc-client) to create a client and server that communicate with the same methods.

json-rpc-server.cabal

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ description: An implementation of the server side of JSON-RPC 2.0.
1818
library uses 'ByteString' for input and output,
1919
leaving the choice of transport up to the user.
2020
See the "Network.JsonRpc.Server" module for an example.
21+
json-rpc-server can be used with
22+
<http://hackage.haskell.org/package/json-rpc-client json-rpc-client>
23+
to create a client and server that communicate
24+
with the same methods.
2125

2226
source-repository head
2327
type: git

src/Network/JsonRpc/Types.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ instance A.FromJSON Request where
138138
data Response = Response Id (Either RpcError A.Value)
139139

140140
instance NFData Response where
141-
rnf (Response i e) = rnf i `seq` rnf e `seq` ()
141+
rnf (Response i e) = rnf i `seq` rnf e
142142

143143
instance A.ToJSON Response where
144144
toJSON (Response i result) = A.object pairs
@@ -151,8 +151,8 @@ instance A.ToJSON Response where
151151
data Id = IdString A.Value | IdNumber A.Value | IdNull
152152

153153
instance NFData Id where
154-
rnf (IdString s) = rnf s `seq` ()
155-
rnf (IdNumber n) = rnf n `seq` ()
154+
rnf (IdString s) = rnf s
155+
rnf (IdNumber n) = rnf n
156156
rnf IdNull = ()
157157

158158
instance A.FromJSON Id where
@@ -173,7 +173,7 @@ data RpcError = RpcError { errCode :: Int
173173
deriving (Show, Eq)
174174

175175
instance NFData RpcError where
176-
rnf (RpcError e m d) = rnf e `seq` rnf m `seq` rnf d `seq` ()
176+
rnf (RpcError e m d) = rnf e `seq` rnf m `seq` rnf d
177177

178178
instance Error RpcError where
179179
noMsg = strMsg "unknown error"

tests/TestParallelism.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ testParallelizingTasks = do
4141

4242
possibleResponses :: [[A.Value]]
4343
possibleResponses = (rsp <$>) <$> perms
44-
where perms = zip `zipWith` repeat [1, 2, 3] $ permutations ["A", "B", "C"]
44+
where perms = map (zip [1, 2, 3]) $ permutations ["A", "B", "C"]
4545
rsp (i, r) = defaultRsp `result` A.String r `id'` Just (A.Number i)
4646

4747
lockRequest :: Int -> A.Value

0 commit comments

Comments
 (0)