OCaml let rec x = Json_encoder.y printer.

Primitive and reference types are never on the LHS of an equation. Instead, they are expanded when used on the RHS of an equation.

A nested compound type is fully printed on the RHS of an equation.

Sourcemodule type S = sig ... end

Functions from this module that can be shared with other modules.

Sourceval wrap_primitive_and_ref_with_optional : bool
Sourceval singletons_of_array : len:int -> [ `List of [ `Any | `Array of [ `List of 'a | `Singleton of 'a ] list | `Boolean | `Choice of 'a list | `Integer | `Null | `Number | `ObjectN of (string * 'a) list | `String ] as 'a | `Singleton of 'a ] list -> 'a list
Sourceval form_urlencode_string : string -> string
Sourceval form_urldecode_string : string -> string
Sourceval splat : Restapis_o.Open__.Ezjsonm.value -> (string * Restapis_o.Open__.Ezjsonm.value option) list
Sourceval json_to_string : [ `Any | `Array of [ `List of 'a | `Singleton of 'a ] list | `Boolean | `Choice of 'a list | `Integer | `Null | `Number | `ObjectN of (string * 'a) list | `String ] as 'a -> Restapis_o.Open__.Ezjsonm.value -> string
Sourceval string_to_json : p:string -> sep:char -> inner_sep:char -> value_sep:char option -> leading:bool -> [ `Any | `Array of [ `List of 'a | `Singleton of 'a ] list | `Boolean | `Choice of 'a list | `Integer | `Null | `Number | `ObjectN of (string * 'a) list | `String ] as 'a -> string -> Restapis_o.Open__.Ezjsonm.value option * int
Sourceval json_to_form : string -> [ `Any | `Array of [ `List of 'a | `Singleton of 'a ] list | `Boolean | `Choice of 'a list | `Integer | `Null | `Number | `ObjectN of (string * 'a) list | `String ] as 'a -> Restapis_o.Open__.Ezjsonm.value -> string list
Sourceval string_to_best_json_choice : p:string -> sep:char -> inner_sep:char -> value_sep:char option -> leading:bool -> kindchoices: [ `Any | `Array of [ `List of 'a | `Singleton of 'a ] list | `Boolean | `Choice of 'a list | `Integer | `Null | `Number | `ObjectN of (string * 'a) list | `String ] as 'a list -> string -> Restapis_o.Open__.Ezjsonm.value option * int
Sourceval nvs_to_json : kind: [ `Any | `Array of [ `List of 'a | `Singleton of 'a ] list | `Boolean | `Choice of 'a list | `Integer | `Null | `Number | `ObjectN of (string * 'a) list | `String ] as 'a -> p:[ `None | `Deep of string | `Shallow of string ] -> sep:char -> inner_sep:char -> value_sep:char option -> leading:bool -> (string * string) list -> Restapis_o.Open__.Ezjsonm.value option

nvs_to_json ~kind ~p ~sep ~inner_sep ~leading nvs takes the name value pairs nvs and attempts to convert them to a JSON object of kind kind.

When p = None, all the name value pairs are considered. That mode is good for decoding forms.

When p = Some propname, only the name value pairs that use the property name propname are considered. For example, when propname = Some "color" then nvs = [("color", "red"); ("color[]", "blue"), ("color[rgb]", "FFFFFF")] will all be considered.

Sourcemodule Make (OCamlCommon : OaMlLang.OCAML) : sig ... end
include DkCoder_Std.SCRIPT
Sourceval __init : DkCoder_Std.Context.t -> unit

__init context is the entry point for running a script module. The DkCoder compiler will inject this function at the top and bottom of the script module. The top __init does nothing, while the bottom __init calls the prior __init.

That means:

  1. calling the __init function guarantees that the script module is initialized; that is, all of the script module's side-effects (ex. let () = Format.printf "Hello world@.") are executed before the __init returns to the caller.
  2. you can override the __init function by simply defining the __init idempotently. That will shadow the top __init and when the bottom __init is executed your __init will be called instead of the do-nothing top __init.

Future versions of DkCoder will call __init in dependency order for all `You script modules. Your __init function may be called several times.

Sourceval __repl : DkCoder_Std.Context.t -> unit

__repl context is the entry point for debugging a script module in a REPL. The DkCoder compiler will inject this function at the top and bottom of the script module. The top __repl does nothing, while the bottom __repl calls the prior __repl.

That means:

  1. you can override the __repl function by simply defining the __repl idempotently. That will shadow the top __repl and when the bottom __repl is executed your __repl will be called instead of the do-nothing top __repl.
Sourceval __module_info : unit -> DkCoder_Std.ModuleInfo.t

The run-time module information for the script module.