Commit d4601c54 authored by Nicolas Pouillard's avatar Nicolas Pouillard Committed by Alexandre Delanoë

[NGRAMS-TABLE]: Fix EncodeJson instance for Replace

parent b4bbc9e2
......@@ -169,10 +169,13 @@ applyReplace (Replace { old, new }) a
| otherwise = a
instance encodeJsonReplace :: EncodeJson a => EncodeJson (Replace a) where
encodeJson Keep = jsonEmptyObject
encodeJson Keep
= "tag" := "Keep"
~> jsonEmptyObject
encodeJson (Replace {old, new})
= "old" := old
~> "new" := new
~> "tag" := "Replace"
~> jsonEmptyObject
instance decodeJsonReplace :: (DecodeJson a, Eq a) => DecodeJson (Replace a) where
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment