← All repos

ppx_compare

Generation of comparison functions from types

Browse cluster: OCaml incremental computation and PPX tooling
115commits
6contributors
3languages

Tech stack & purpose

Ppx_compare is a ppx rewriter for OCaml that automatically generates fast comparison and equality functions from type definitions and expressions. The tool addresses the problem domain of type-driven code generation in OCaml, providing developers with more efficient alternatives to the standard `Pervasives.compare` and `Pervasives.(=)` functions while offering greater flexibility through customization options like ignoring specific fields or providing custom implementations. Built on `ppx_deriving` and `ppx_type_conv`, ppx_compare integrates with the OCaml type system and supports advanced features including local allocation, implicit unboxed records, and zero-alloc annotations.

Languages

OCaml
99.8%
Makefile
0.2%
Dune
0.0%

Contributors