Module Ppxlib__.Deriving
module Args : sig ... end
Specification of generator arguments
Generator registration
val add : ?str_type_decl:(Ppxlib__.Import.structure, Ppxlib__.Import.rec_flag * Ppxlib__.Import.type_declaration Ppxlib__.Import.list) Generator.t -> ?str_type_ext:(Ppxlib__.Import.structure, Ppxlib__.Import.type_extension) Generator.t -> ?str_exception:(Ppxlib__.Import.structure, Ppxlib__.Import.type_exception) Generator.t -> ?str_module_type_decl:(Ppxlib__.Import.structure, Ppxlib__.Import.module_type_declaration) Generator.t -> ?sig_type_decl:(Ppxlib__.Import.signature, Ppxlib__.Import.rec_flag * Ppxlib__.Import.type_declaration Ppxlib__.Import.list) Generator.t -> ?sig_type_ext:(Ppxlib__.Import.signature, Ppxlib__.Import.type_extension) Generator.t -> ?sig_exception:(Ppxlib__.Import.signature, Ppxlib__.Import.type_exception) Generator.t -> ?sig_module_type_decl:(Ppxlib__.Import.signature, Ppxlib__.Import.module_type_declaration) Generator.t -> ?extension:(loc:Ppxlib.Location.t -> path:Ppxlib__.Import.string -> Ppxlib__.Import.core_type -> Ppxlib__.Import.expression) -> Ppxlib__.Import.string -> t
Register 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
fromtype_extension
asexception E
is not exactly the same astype exn += E
. Indeed if the typeexn
is redefined, thentype exn += E
will addE
to the newexn
type whileexception E
will addE
to the predefinedexn
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 : Ppxlib__.Import.string -> ?str_type_decl:t Ppxlib__.Import.list -> ?str_type_ext:t Ppxlib__.Import.list -> ?str_exception:t Ppxlib__.Import.list -> ?str_module_type_decl:t Ppxlib__.Import.list -> ?sig_type_decl:t Ppxlib__.Import.list -> ?sig_type_ext:t Ppxlib__.Import.list -> ?sig_exception:t Ppxlib__.Import.list -> ?sig_module_type_decl:t Ppxlib__.Import.list -> t Ppxlib__.Import.list -> t
add_alias name set
add an alias. When the user write the alias, all the generator ofset
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 ofadd_alias
.
val ignore : t -> Ppxlib__.Import.unit
Ignore a deriver. So that one can write:
Deriving.add ... |> Deriving.ignore