package b0
Install
Dune Dependency
Authors
Maintainers
Sources
sha512=00a6868b4dfa34565d0141b335622a81a0e8d5b9e3c6dfad025dabfa3df2db2a1302b492953bbbce30c3a4406c324fcec25250a00b38f6d18a69e15605e3b07e
doc/b0_b00_kit/B00_serialk_json/Jsong/index.html
Module B00_serialk_json.Jsong
JSON value generation.
Generation
val null : t
null
is the generated JSON null value.
val bool : bool -> t
bool b
is b
as a generated JSON boolean value.
val int : int -> t
int i
is i
as a generated JSON number.
val float : float -> t
float f
is f
as a generated JSON number.
val string : string -> t
str s
is s
as a generated JSON string value.
val array : array
array
is an empty array.
el cond v arr
is el (v ()) arr
if cond
is true
and arr
otherwise.
val obj : obj
obj
is an empty object.
mem_if cond name v o
is mem name (v ()) o
if cond
is true
and o
otherwise.
Derived generators
val strf : ('a, Stdlib.Format.formatter, unit, t) Stdlib.format4 -> 'a
strf fmt ...
is a JSON string generated value formatted according to fmt
.
option some o
is o
as a generated JSON value which is null
if o
is None
and some v
if o
is some v
.
list el l
is l
as a generated JSON array whose elements are generated using el
.
Output
val buffer_add : Stdlib.Buffer.t -> t -> unit
buffer_add b g
adds the generated JSON value g
to b
.
val to_string : t -> string
to_string g
is the generated JSON value g
as a string.