Skip to content

Commit bb13d7c

Browse files
committed
Simplified function
1 parent c0c4959 commit bb13d7c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Network/JsonRpc/Types.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,9 @@ instance FromJSON Id where
134134
parseJSON _ = empty
135135

136136
instance ToJSON Id where
137-
toJSON i = case i of
138-
IdString x -> String x
139-
IdNumber x -> Number x
140-
IdNull -> Null
137+
toJSON (IdString x) = String x
138+
toJSON (IdNumber x) = Number x
139+
toJSON IdNull = Null
141140

142141
-- | Error to be returned to the client.
143142
data RpcError = RpcError Int Text (Maybe Value)

0 commit comments

Comments
 (0)