← All repos

ppx_variants_conv

Generation of accessor and iteration functions for ocaml variant types

Browse cluster: OCaml incremental computation and PPX tooling
119commits
9contributors
3languages

Tech stack & purpose

ppx_variants_conv is a PPX rewriter for OCaml that generates accessor and iteration functions for variant types. It creates first-class constructor functions, helper functions to identify or match on individual constructors, and routines to fold, iterate, and map over all constructors of a variant type, providing equivalent functionality for variants as ppx_fields_conv provides for record types. The project works with standard OCaml variants, polymorphic variants, and GADTs, though with some limitations for the latter. It is built for the OCaml language and integrates with Variantslib.

Languages

OCaml
99.2%
Makefile
0.7%
Dune
0.0%

Contributors