package atdgen

  1. Overview
  2. Docs
type atd_ocaml_sum = [
  1. | `Classic
  2. | `Poly
]
type atd_ocaml_record = [
  1. | `Object
  2. | `Record
]
type atd_ocaml_int = [
  1. | `Char
  2. | `Float
  3. | `Int
  4. | `Int32
  5. | `Int64
]
type atd_ocaml_list = [
  1. | `Array
  2. | `List
]
type atd_ocaml_wrap = {
  1. ocaml_wrap_t : string;
  2. ocaml_wrap : string;
  3. ocaml_unwrap : string;
}
type atd_ocaml_field = {
  1. ocaml_default : string option;
  2. ocaml_fname : string;
  3. ocaml_mutable : bool;
  4. ocaml_fdoc : Ag_doc.doc option;
}
type atd_ocaml_variant = {
  1. ocaml_cons : string;
  2. ocaml_vdoc : Ag_doc.doc option;
}
type atd_ocaml_def = {
  1. ocaml_predef : bool;
  2. ocaml_ddoc : Ag_doc.doc option;
}
type atd_ocaml_repr = [
  1. | `Bool
  2. | `Cell of atd_ocaml_field
  3. | `Def of atd_ocaml_def
  4. | `External of string * string * string
  5. | `Field of atd_ocaml_field
  6. | `Float
  7. | `Int of atd_ocaml_int
  8. | `List of atd_ocaml_list
  9. | `Name of string
  10. | `Nullable
  11. | `Option
  12. | `Record of atd_ocaml_record
  13. | `String
  14. | `Sum of atd_ocaml_sum
  15. | `Tuple
  16. | `Unit
  17. | `Variant of atd_ocaml_variant
  18. | `Wrap of atd_ocaml_wrap option
]
type target = [
  1. | `Biniou
  2. | `Default
  3. | `Json
  4. | `Validate
]
val ocaml_int_of_string : string -> atd_ocaml_int option
val string_of_ocaml_int : atd_ocaml_int -> string
val ocaml_sum_of_string : string -> atd_ocaml_sum option
val ocaml_record_of_string : string -> atd_ocaml_record option
val ocaml_list_of_string : string -> atd_ocaml_list option
val string_of_ocaml_list : atd_ocaml_list -> string
val get_ocaml_int : Atd_annot.t -> atd_ocaml_int
val get_ocaml_type_path : string -> Atd_annot.t -> string
val path_of_target : target -> string list
val get_ocaml_sum : Atd_annot.t -> atd_ocaml_sum
val get_ocaml_field_prefix : Atd_annot.t -> string
val get_ocaml_record : Atd_annot.t -> atd_ocaml_record
val get_ocaml_list : Atd_annot.t -> atd_ocaml_list
val get_ocaml_wrap : Atd_ast.loc -> Atd_annot.t -> atd_ocaml_wrap option
val get_ocaml_cons : string -> Atd_annot.t -> string
val get_ocaml_fname : string -> Atd_annot.t -> string
val get_ocaml_default : Atd_annot.t -> string option
val get_ocaml_mutable : Atd_annot.t -> bool
val get_ocaml_predef : target -> Atd_annot.t -> bool
val get_ocaml_module : target -> Atd_annot.t -> (string * string) option
val get_ocaml_t : target -> string -> Atd_annot.t -> string
val get_ocaml_module_and_t : target -> string -> Atd_annot.t -> (string * string * string) option
type ocaml_type_param = string list
type ocaml_expr = [
  1. | `Name of string * ocaml_expr list
  2. | `Record of atd_ocaml_record * ocaml_field list
  3. | `Sum of atd_ocaml_sum * ocaml_variant list
  4. | `Tuple of ocaml_expr list
  5. | `Tvar of string
]
and ocaml_variant = string * ocaml_expr option * Ag_doc.doc option
and ocaml_field = (string * bool) * ocaml_expr * Ag_doc.doc option
type ocaml_def = {
  1. o_def_name : string * ocaml_type_param;
  2. o_def_alias : (string * ocaml_type_param) option;
  3. o_def_expr : ocaml_expr option;
  4. o_def_doc : Ag_doc.doc option;
}
type ocaml_module_item = [
  1. | `Type of ocaml_def
]
type ocaml_module_body = ocaml_module_item list
val omap : ('a -> 'b) -> 'a option -> 'b option
val map_expr : Atd_ast.type_expr -> ocaml_expr
val map_variant : Atd_ast.variant -> ocaml_variant
val map_field : string -> Atd_ast.field -> ocaml_field
val map_def : target:target -> type_aliases:string option -> Atd_ast.type_def -> ocaml_def option
val select : ('a -> 'b option) -> 'a list -> 'b list
val map_module : target:target -> type_aliases:string option -> Atd_ast.module_body -> ocaml_module_body
val ocaml_of_expr_mapping : (atd_ocaml_repr, 'a) Ag_mapping.mapping -> ocaml_expr
val ocaml_of_variant_mapping : (atd_ocaml_repr, 'a) Ag_mapping.variant_mapping -> ocaml_variant
val ocaml_of_field_mapping : (atd_ocaml_repr, 'a) Ag_mapping.field_mapping -> ocaml_field
val make_atom : string -> Easy_format.t
val horizontal_sequence : Easy_format.t list -> Easy_format.t
val horizontal_sequence0 : Easy_format.t list -> Easy_format.t
val insert : 'a list -> 'a list -> 'a list
val insert2 : ('a -> 'a -> 'a list) -> 'a list -> 'a list
val vertical_sequence : ?skip_lines:int -> Easy_format.t list -> Easy_format.t
val escape : (char -> string option) -> string -> string
val ocamldoc_escape : string -> string
val ocamldoc_verbatim_escape : string -> string
val split : string -> string list
val make_ocamldoc_block : [< `Before_paragraph | `Paragraph of [< `Code of string | `Text of string ] list | `Pre of string ] -> Easy_format.t
val make_ocamldoc_blocks : Ag_doc.block list -> Easy_format.t list
val make_ocamldoc_comment : [< `Text of Ag_doc.block list ] -> Easy_format.t
val prepend_ocamldoc_comment : [< `Text of Ag_doc.block list ] option -> Easy_format.t -> Easy_format.t
val append_ocamldoc_comment : Easy_format.t -> [< `Text of Ag_doc.block list ] option -> Easy_format.t
val format_pp_conv_node : Easy_format.t -> [ `Camlp4 of string list | `Ppx of string list ] -> Easy_format.t
val format_module_item : [ `Camlp4 of string list | `Ppx of string list ] -> bool -> ocaml_module_item -> Easy_format.t
val prepend_type_param : ocaml_type_param -> Easy_format.t list -> Easy_format.t list
val prepend_type_args : ocaml_expr list -> Easy_format.t list -> Easy_format.t list
val format_type_expr : ocaml_expr -> Easy_format.t
val format_type_name : string -> ocaml_expr list -> Easy_format.t
val format_field : ocaml_field -> Easy_format.t
val format_variant : atd_ocaml_sum -> ocaml_variant -> Easy_format.t
val format_module_items : [ `Camlp4 of string list | `Ppx of string list ] -> 'a -> ocaml_module_body -> Easy_format.t list
val format_module_bodies : [ `Camlp4 of string list | `Ppx of string list ] -> (bool * ocaml_module_body) list -> Easy_format.t list
val format_head : (Atd_ast.loc * Atd_ast.annot) -> Easy_format.t list
val format_all : Easy_format.t list -> Easy_format.t
val ocaml_of_expr : ocaml_expr -> string
val ocaml_of_atd : ?pp_convs:[ `Camlp4 of string list | `Ppx of string list ] -> target:target -> type_aliases:string option -> ((Atd_ast.loc * Atd_ast.annot) * (bool * Atd_ast.module_body) list) -> string
val unwrap_option : ('a -> ('b, 'c) Ag_mapping.mapping) -> 'a -> ('b, 'c) Ag_mapping.mapping
val get_implicit_ocaml_default : ('a -> [> `Bool of 'b * [> `Bool ] * 'c | `Float of 'd * [> `Float ] * 'e | `Int of 'f * [> `Int of [< `Char | `Float | `Int | `Int32 | `Int64 ] ] * 'g | `List of 'h * 'i * [> `List of [> `Array | `List ] ] * 'j | `Nullable of 'k * 'l * [> `Nullable ] * 'm | `Option of 'n * 'o * [> `Option ] * 'p | `String of 'q * [> `String ] * 'r | `Unit of 's * [> `Unit ] * 't ]) -> 'a -> string option
val map_record_creator_field : ((atd_ocaml_repr, 'a) Ag_mapping.mapping -> (atd_ocaml_repr, 'b) Ag_mapping.mapping) -> (atd_ocaml_repr, 'a) Ag_mapping.field_mapping -> string * string * string
OCaml

Innovation. Community. Security.