I am trying to do a tricky manipulation of
ml with ppxlib.
I currently have a ppx_rewriter where I override the
class mapper = object (_self) inherit Ast_traverse.map as super method! structure_item stri = .. method! signature_item sigi = .. end let () = let mapper = new mapper in Driver.register_transformation "some_ppx" ~impl:mapper#structure ~intf:mapper#signature
But in a perfect world I would have a function of type:
val expand : structure_item -> signature_item option -> structure_item
Where I could have at the same time the structure and optionally the signature of any item in the code.
From what I understand the preprocessing is applied to the
.mli and then the
ml. I don’t know if there’s
any classy way to link any structure_item to its signature item.