I want to pre-process an OCaml snippet and make some modifications on the snippet, based on the type of certain expressions. For example, if the snippet has:
(f [1;2;3])
I would add another parameter to f like:
(f [1;2;3] [[0]])
.
But if I see something like:
(f ["a"; "b"])
Then I might want to:
(f ["a"; "b"] [[""]])
I was looking at camlp4, though I am not thorough with it; I think camlp4 doesn't have type information about the expressions.
Is there any way I can do this? Thanks!