* [Caml-list] Ppx_deriving and plugins for plugins (aka metaplugins)
@ 2016-07-13 9:34 Kakadu
0 siblings, 0 replies; only message in thread
From: Kakadu @ 2016-07-13 9:34 UTC (permalink / raw)
To: Caml List
Salut, fellas
Let's say I want to create a few derivers which should generate two
parts of code:
1) specific for this family of derivers;
2) specific for concrete deriver.
For example
[@@deriving der_family { deriver1; deriver2 }]
should generate
(* XXX code specific for family *)
(* ZZZ1 code which relies on XXX and which is specific for deriver1 *)
(* ZZZ2 code which relies on XXX and which is specific for deriver2 *)
And [@@deriving der_family { deriver1}] should generate
(* XXX code specific for family *)
(* YYY code which relies on XXX and which is specific for deriver1 *)
This approach should work well until I wish to support [@@deriving
der_family { deriver3 }] as a separate project. AFAIU, at the moment
ppx_deriving chooses plugin by it's exported name (i.e. der_family in
[@@deriving der_family { deriver3 }] ) but it seems that I need some
parametrization over deriver parameters.
Is it already supported? Is it easy to implement? Or I should do this
in a more straightforward manner?
Happy hacking,
Kakadu
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-07-13 9:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-13 9:34 [Caml-list] Ppx_deriving and plugins for plugins (aka metaplugins) Kakadu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).