package ppxlib
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=89e049b3102f6670a213d34d802ea3ab0fc530a8959d2f1a1e8db830063429a3
sha512=2fbbf124fc61e1f22242d13505e9af39d4a3c7cf03def1c33ee8bd915195be9b817636667302e9c6ceddc74a9a4a54926340e21c96fd770a2bc6752400315cfd
doc/ppxlib/Ppxlib/Deriving/index.html
Module Ppxlib.DerivingSource
Deriving code from type declarations.
Generator registration
Type of registered derivers
val add :
?str_type_decl:
(Astlib.Ast_502.Parsetree.structure_item list,
Astlib.Ast_502.Asttypes.rec_flag
* Astlib.Ast_502.Parsetree.type_declaration list)
Generator.t ->
?str_class_type_decl:
(Astlib.Ast_502.Parsetree.structure_item list,
Astlib.Ast_502.Parsetree.class_type Astlib.Ast_502.Parsetree.class_infos
list)
Generator.t ->
?str_type_ext:
(Astlib.Ast_502.Parsetree.structure_item list,
Astlib.Ast_502.Parsetree.type_extension)
Generator.t ->
?str_exception:
(Astlib.Ast_502.Parsetree.structure_item list,
Astlib.Ast_502.Parsetree.type_exception)
Generator.t ->
?str_module_type_decl:
(Astlib.Ast_502.Parsetree.structure_item list,
Astlib.Ast_502.Parsetree.module_type_declaration)
Generator.t ->
?str_module_binding:
(Astlib.Ast_502.Parsetree.structure_item list,
Astlib.Ast_502.Parsetree.module_binding)
Generator.t ->
?sig_type_decl:
(Astlib.Ast_502.Parsetree.signature_item list,
Astlib.Ast_502.Asttypes.rec_flag
* Astlib.Ast_502.Parsetree.type_declaration list)
Generator.t ->
?sig_class_type_decl:
(Astlib.Ast_502.Parsetree.signature_item list,
Astlib.Ast_502.Parsetree.class_type Astlib.Ast_502.Parsetree.class_infos
list)
Generator.t ->
?sig_type_ext:
(Astlib.Ast_502.Parsetree.signature_item list,
Astlib.Ast_502.Parsetree.type_extension)
Generator.t ->
?sig_exception:
(Astlib.Ast_502.Parsetree.signature_item list,
Astlib.Ast_502.Parsetree.type_exception)
Generator.t ->
?sig_module_type_decl:
(Astlib.Ast_502.Parsetree.signature_item list,
Astlib.Ast_502.Parsetree.module_type_declaration)
Generator.t ->
?sig_module_decl:
(Astlib.Ast_502.Parsetree.signature_item list,
Astlib.Ast_502.Parsetree.module_declaration)
Generator.t ->
?extension:
(loc:Location.t ->
path:string ->
Astlib.Ast_502.Parsetree.core_type ->
Astlib.Ast_502.Parsetree.expression) ->
string ->
tRegister a new deriving generator.
The various arguments are for the various items on which derivers can be attached in structure and signatures.
We distinguish exception from type_extension as exception E is not exactly the same as type exn += E. Indeed if the type exn is redefined, then type exn += E will add E to the new exn type while exception E will add E to the predefined exn type.
extension register an expander for extension with the name of the deriver. This is here mostly to support the ppx_deriving backend.
val add_alias :
string ->
?str_type_decl:t list ->
?str_class_type_decl:t list ->
?str_type_ext:t list ->
?str_exception:t list ->
?str_module_type_decl:t list ->
?str_module_binding:t list ->
?sig_type_decl:t list ->
?sig_class_type_decl:t list ->
?sig_type_ext:t list ->
?sig_exception:t list ->
?sig_module_type_decl:t list ->
?sig_module_decl:t list ->
t list ->
tadd_alias name set add an alias. When the user write the alias, all the generator of set will be used instead. It is possible to override the set for any of the context by passing the specific set in the approriate optional argument of add_alias.