Skip to main content

Module json

Module json 

Source
Expand description

The canonical JSON bridge (tr-grammar §7).

One value format serves show/parse, tests, the REPL, FFI marshalling, and host stubs. Encoding is canonical — equal values produce byte-equal output — and decoding is always type-directed.

Functions§

decode
Decode canonical (or canonically-equivalent) JSON into a value of the given shape — the runtime half of parse (design §3.7).
encode
Encode a value into canonical JSON — the runtime half of show (design §3.7). Equal values produce byte-equal output.