Type-driven code generation for OCaml >=4.02