package atdgen

  1. Overview
  2. Docs
val name_of_var : string -> string
type param = {
  1. deref : (Ag_ocaml.atd_ocaml_repr, Ag_json.json_repr) Ag_mapping.mapping -> (Ag_ocaml.atd_ocaml_repr, Ag_json.json_repr) Ag_mapping.mapping;
  2. std : bool;
  3. unknown_field_handler : string option;
  4. constr_mismatch_handler : string option;
  5. force_defaults : bool;
  6. preprocess_input : string option;
  7. ocaml_version : (int * int) option;
}
val make_ocaml_json_intf : with_create:bool -> Buffer.t -> ((Ag_ocaml.atd_ocaml_repr, 'a) Ag_mapping.mapping -> (Ag_ocaml.atd_ocaml_repr, 'b) Ag_mapping.mapping) -> ('c * (Ag_ocaml.atd_ocaml_repr, 'a) Ag_mapping.def list) list -> unit
val is_json_string : (('a, 'b) Ag_mapping.mapping -> ('a, 'b) Ag_mapping.mapping) -> ('a, 'b) Ag_mapping.mapping -> bool
val get_assoc_type : (([> `Tuple ] as 'a, [> `Tuple ] as 'b) Ag_mapping.mapping -> ('a, 'b) Ag_mapping.mapping) -> Atd_ast.loc -> ('a, 'b) Ag_mapping.mapping -> ('a, 'b) Ag_mapping.mapping * ('a, 'b) Ag_mapping.mapping
val nth : string -> int -> int -> string
type default_field =
  1. | Default of string
  2. | Checked of int
type parse_field = {
  1. mapping : (Ag_oj_mapping.o, Ag_oj_mapping.j) Ag_mapping.field_mapping;
  2. default : default_field;
  3. ocamlf : Ag_ocaml.atd_ocaml_field;
  4. jsonf : Ag_json.json_field;
  5. field_ref : string;
  6. constructor : int option;
  7. payloads : int list;
  8. implicit : bool;
}
val implicit_field_name : string -> string
val insert : 'a -> 'a list -> 'a list
val make_json_string : string -> string
val unopt : 'a option -> 'a
val get_writer_name : ?paren:bool -> ?name_f:(string -> string) -> param -> Ag_oj_mapping.oj_mapping -> string
val get_left_writer_name : param -> string -> string list -> string
val get_left_to_string_name : param -> string -> string list -> string
val get_reader_name : ?paren:bool -> ?name_f:(string -> string) -> 'a -> Ag_oj_mapping.oj_mapping -> string
val get_left_reader_name : 'a -> string -> string list -> string
val get_left_of_string_name : 'a -> string -> string list -> string
val make_sum_writer : param -> (Ag_ocaml.atd_ocaml_repr, Ag_json.json_repr) Ag_mapping.mapping -> (param -> string -> Ag_ocaml.atd_ocaml_variant -> Ag_json.json_variant -> (Ag_ocaml.atd_ocaml_repr, Ag_json.json_repr) Ag_mapping.variant_mapping -> Ag_indent.t list) -> [> `Annot of string * [> `Line of string ] | `Block of Ag_indent.t list ] list
val is_optional : parse_field -> bool
val string_expr_of_constr_field : param -> (parse_field -> string) -> parse_field -> [> `Annot of string * [> `Line of string ] | `Block of Ag_indent.t list | `Line of string ] list
val make_writer : param -> Ag_oj_mapping.oj_mapping -> Ag_indent.t list
val study_record : param -> parse_field array -> [> `Inline of [> `Line of string ] list | `Line of string ] list * [> `Line of string ] list * (int -> [> `Line of string ]) * [> `Line of string ] list * [> `Block of [> `Block of 'a list | `Line of string ] list | `Line of string ] list
val make_reader : param -> string option -> Ag_oj_mapping.oj_mapping -> Ag_indent.t list
val make_variant_reader : param -> string option -> string -> bool -> (Ag_ocaml.atd_ocaml_repr, Ag_json.json_repr) Ag_mapping.variant_mapping -> string * Ag_indent.t list
val make_deconstructed_reader : param -> Atd_ast.loc -> parse_field array -> (int -> Ag_indent.t) -> Ag_indent.t list
val make_record_reader : param -> string option -> Ag_mapping.loc -> (Ag_oj_mapping.o, Ag_oj_mapping.j) Ag_mapping.field_mapping array -> Ag_ocaml.atd_ocaml_record -> Ag_indent.t list
val make_ocaml_json_writer : param -> original_types:(string, string * int) Hashtbl.t -> bool -> string -> string -> (Ag_ocaml.atd_ocaml_repr, Ag_json.json_repr) Ag_mapping.def -> [> `Block of Atd_indent.t list | `Line of string ] list
val make_ocaml_json_reader : param -> original_types:(string, string * int) Hashtbl.t -> bool -> string -> string -> (Ag_ocaml.atd_ocaml_repr, Ag_json.json_repr) Ag_mapping.def -> [> `Block of Atd_indent.t list | `Line of string ] list
val map : (bool -> 'a -> 'b) -> 'a list -> 'b list
val get_let : is_rec:bool -> is_first:bool -> string * string
val make_ocaml_json_impl : std:bool -> unknown_field_handler:string option -> constr_mismatch_handler:string option -> with_create:bool -> force_defaults:bool -> preprocess_input:string option -> original_types:(string, string * int) Hashtbl.t -> ocaml_version:(int * int) option -> Buffer.t -> ((Ag_ocaml.atd_ocaml_repr, Ag_json.json_repr) Ag_mapping.mapping -> (Ag_ocaml.atd_ocaml_repr, Ag_json.json_repr) Ag_mapping.mapping) -> (bool * (Ag_ocaml.atd_ocaml_repr, Ag_json.json_repr) Ag_mapping.def list) list -> unit
val translate_mapping : (bool * Atd_ast.module_body) list -> (bool * (Ag_ocaml.atd_ocaml_repr, Ag_json.json_repr) Ag_mapping.def list) list
val write_opens : Buffer.t -> string list -> unit
val make_mli : header:string -> opens:string list -> with_typedefs:bool -> with_create:bool -> with_fundefs:bool -> string -> ((Ag_ocaml.atd_ocaml_repr, 'a) Ag_mapping.mapping -> (Ag_ocaml.atd_ocaml_repr, 'b) Ag_mapping.mapping) -> ('c * (Ag_ocaml.atd_ocaml_repr, 'a) Ag_mapping.def list) list -> string
val make_ml : header:string -> opens:string list -> with_typedefs:bool -> with_create:bool -> with_fundefs:bool -> std:bool -> unknown_field_handler:string option -> constr_mismatch_handler:string option -> force_defaults:bool -> preprocess_input:string option -> original_types:(string, string * int) Hashtbl.t -> ocaml_version:(int * int) option -> string -> ((Ag_ocaml.atd_ocaml_repr, Ag_json.json_repr) Ag_mapping.mapping -> (Ag_ocaml.atd_ocaml_repr, Ag_json.json_repr) Ag_mapping.mapping) -> (bool * (Ag_ocaml.atd_ocaml_repr, Ag_json.json_repr) Ag_mapping.def list) list -> string
val make_ocaml_files : opens:string list -> with_typedefs:bool -> with_create:bool -> with_fundefs:bool -> all_rec:bool -> std:bool -> unknown_field_handler:string option -> constr_mismatch_handler:string option -> pos_fname:string option -> pos_lnum:int option -> type_aliases:string option -> force_defaults:bool -> preprocess_input:string option -> name_overlap:bool -> ocaml_version:(int * int) option -> pp_convs:[ `Camlp4 of string list | `Ppx of string list ] -> string option -> [< `Files of string | `Stdout ] -> unit
OCaml

Innovation. Community. Security.