Bindoj_gen.Caml_datatype
This module provides functionalities to generate OCaml types.
val type_declaration_of_type_decl :
?type_name:string ->
?attrs:Ppxlib.attribute list ->
Bindoj_base.Type_desc.type_decl ->
Ppxlib.type_declaration
Generates a type declaration.
val gen_reflect :
?codec:Bindoj_base.Type_desc.Coretype.codec ->
Bindoj_base.Type_desc.type_decl ->
Ppxlib.value_binding
Generates a reflection.
val gen_structure :
?type_name:string ->
?refl:bool ->
?attrs:Ppxlib.attribute list ->
?codec:Bindoj_base.Type_desc.Coretype.codec ->
?generators:
(?codec:Bindoj_base.Type_desc.Coretype.codec ->
Bindoj_base.Type_desc.type_decl ->
Ppxlib.structure)
list ->
?type_decl:[ `path of string | `expr of Ppxlib.expression ] ->
Bindoj_base.Type_desc.type_decl ->
Ppxlib.structure
generate the whole structure containing the results of type_declaration_of_type_decl
and gen_reflect
.
val gen_reflect_signature :
?refl_type_abbr:string ->
?codec:Bindoj_base.Type_desc.Coretype.codec ->
Bindoj_base.Type_desc.type_decl ->
Ppxlib.value_description
Generaets a signatuoe of reflection
val gen_signature :
?type_name:string ->
?refl:bool ->
?attrs:Ppxlib.attribute list ->
?codec:Bindoj_base.Type_desc.Coretype.codec ->
?generators:
(?codec:Bindoj_base.Type_desc.Coretype.codec ->
Bindoj_base.Type_desc.type_decl ->
Ppxlib.signature)
list ->
?type_decl:bool ->
?refl_type_abbr:string ->
?type_decl_type_abbr:string ->
?typed_type_decl_type_abbr:string ->
Bindoj_base.Type_desc.type_decl ->
Ppxlib.signature
generate the whole signature containing the results of type_declaration_of_type_decl
and gen_reflect_signature
.