Skip to content

Commit

Permalink
encode and decode JSValues instead of JSObjects
Browse files Browse the repository at this point in the history
This is consistent with the aeson encode en decode.
This does not change the benchmark results.
  • Loading branch information
basvandijk committed Dec 21, 2011
1 parent dcc6b73 commit 38e1482
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions benchmarks/CompareWithJSON.hs
Expand Up @@ -18,13 +18,13 @@ instance NFData J.JSValue where
rnf (J.JSArray lst) = rnf lst
rnf (J.JSObject o) = rnf o

encodeJ :: J.JSObject J.JSValue -> Int
encodeJ :: J.JSValue -> Int
encodeJ = length . J.encode

encodeA :: A.Value -> Int64
encodeA = BL.length . A.encode

decodeJ :: String -> J.JSObject J.JSValue
decodeJ :: String -> J.JSValue
decodeJ s =
case J.decodeStrict s of
J.Ok v -> v
Expand Down

0 comments on commit 38e1482

Please sign in to comment.