keen/json

Source
This is a standard module and does not need to be explicitly imported.
json record (has private fields)
JSON data. The representation is deliberately opaque to allow precise representation of numbers. Generally you should use 'to::t' to read a JSON value as the type you expect it to be. If you really need to match on a json value, use simplify.
interpolate json(parts string[])
deserialize-error record
value json
== bool(a deserialize-error, b deserialize-error)
to json(a deserialize-error)
show string(a deserialize-error)
json-simplified union
== bool(a json-simplified, b json-simplified)
simplify json-simplified(a json)
== bool(a json, b json)
to string(a json)
null record (has private fields)
== bool(a null, b null)
to json(a null)
list-new json(args json[])
If no arguments are passed this is null. Otherwise it is a JSON array. For an empty JSON array, use ()::json[] to
named-new json(keys symbol[], values json[])
null json()
false json()
true json()
empty-array json()
empty-object json()
to json(a json)
to json(_ void)
to json(a bool)
to json(a char8)
to json(a char32)
to json(a string)
to json(a nat8)
to nat8(a json)
to json(a nat16)
to nat16(a json)
to json(a nat32)
to nat32(a json)
to json(a nat64)
to nat64(a json)
to json(a int8)
to int8(a json)
to json(a int16)
to int16(a json)
to json(a int32)
to int32(a json)
to json(a int64)
to int64(a json)
to json(a float32)
to float32(a json)
to json(a float64)
to float64(a json)
to json(a symbol)
to symbol(a json)
to[t] json(a t[]) (json, t) to
to[t] json(a t array-view) (json, t) to
to[t] json(a t buffer) (json, t) to
to[t] json(a t buffer-view) (json, t) to
to[t] json(a t mut[]) (json, t) to
to[t] json(a t set) (json, t) to, t key
to[k, v] json(a v[k]) k key, (symbol, k) to, (json, v) to
to[v] v[symbol](a json) (v, json) to
to[t] json(a t option) (json, t) to
to[t, u] json(a (t, u)) (json, t) to, (json, u) to
to[t, u, v] json(a (t, u, v) tuple3) (json, t) to, (json, u) to, (json, v) to
to json(a comparison)
subscript json(a json, key symbol)

If a is an object containing the key key, returns the associated value. Returns null if any of these is true: * a is not an object. * a is an object, but does not have key. * a is an object with the key, and its value is null.

Most code does not care about this distinction. If you do, you can test if a.simplify map or if a has-key key.

has-key bool(a json, key symbol)
true if a is an object and key is one of its keys.
to bool(a json)
a bool-or-null is like a bool, but treats null as false.
to[t] t option(a json) (t, json) to
to[t] t[](a json) (t, json) to
show string(a json)
By default, json is shown using Kid syntax.
to-json[t] string(a t) (json, t) to
Converts a value to json and renders it as standard JSON.
omit-empty-values json(a json)
deep-omit-empty-values json(a json)
For every object in the json value, omit a key if the value is null, an empty array, or an empty object.
to-kid[t] string(a t) (json, t) to
Converts a value to json and renders it as Kid.
json json grammar()
kid json grammar()