The implementation technique used by Jun Furuse is to duplicate the implementation of the type-checker, and change only the parts that type-check constructor applications. This is the least-constraining way to write type-aware transformations as ppx extensions. A more concise way is to call compiler-libs for type-checking and postprocess the resulting typed AST, but this is only reasonable if the input source is expected to be well-typed. (There are few limit on the kind of transformations you can do if you are, in fact, willing to fork the compiler codebase if necessary. But, as Jonas Jensen mentioned, this is "adventurous" indeed.) On Fri, Nov 6, 2015 at 1:46 PM, Soegtrop, Michael < michael.soegtrop@intel.com> wrote: > Dear Jonas, > > thanks for the link! It is interesting that others feel enough pain to > write 200k of code to get a nicer and more flexible constructor syntax. > Also interesting that it takes > 200k of code to do this even with ppx. And > I am not sure if this would works for matches - at least there are none in > the test files. For sure I need to gather a bit more experience before I > dig into this. > > Best regards, > > Michael > Intel Deutschland GmbH > Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany > Tel: +49 89 99 8853-0, www.intel.de > Managing Directors: Christin Eisenschmid, Christian Lamprechter > Chairperson of the Supervisory Board: Nicole Lau > Registered Office: Munich > Commercial Register: Amtsgericht Muenchen HRB 186928 > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >