← All repos

ocaml-ppx_gen_rec

ocaml preprocessor that generates a recursive module

Browse cluster: Cluster 88
16commits
3contributors
1languages

Tech stack & purpose

ocaml-ppx_gen_rec is an OCaml preprocessor (ppx rewriter) that transforms recursive module expressions into explicit struct definitions. It solves a problem where using `ppx_deriving` with recursive modules results in undefined recursive module exceptions, by generating an implementation struct that allows derived code to be properly instantiated. The tool is designed to be used before `ppx_deriving` in the preprocessing pipeline, activated by writing `module%gen rec` instead of `module rec`.

Languages

OCaml
100.0%

Contributors