type Json
import bend-toon-codec@0.1.0.0/main.bend as BendToonCodecimport Base
19# JSON values. Arrays and objects are chains inside Json itself: an array is
20# JArr{JCons{a, JCons{b, JNil{}}}}, an object is
21# JObj{JField{"k", v, JField{"k2", v2, JNil{}}}}. Numbers keep their decimal
22# text (JNum{"1.50"}); encode writes the canonical form.
23type Json is Data:
24 JNull{}
25 JBool{b: Bool}
26 JNum{text: String}
27 JStr{s: String}
28 JArr{items: Json}
29 JObj{fields: Json}
30 JNil{}
31 JCons{head: Json, tail: Json}
32 JField{key: String, val: Json, tail: Json}