I (seem) to understand that when I adorn a type foo with a deriving attribute (e.g. show and eq)
I will get foo_show: foo -> string
and foo_eq: foo -> foo -> bool
But what I really would like to have is something like this
module type Foo = sig
type t
end [@@deriving show, eq]
which then expands into
module type Foo = sig
type t
val show: t -> string
val eq: t -> t -> bool
end
By default, the functions generated by a plugin for a type foo are called fn_foo or foo_fn . However, if the type is called type t , the function will be named foo . The defaults can be overridden by an affix = true|false plugin option.
i have a related question: is there a way to set defaults for ppx_deriving module-wide. for instance, for show, i would like to set the option of not printing module paths (i think it’s {paths = False} or something like that) once and for all, and not in every single [@@deriving ..] annotation