← All repos

ppx_custom_printf

Printf-style format-strings for user-defined string conversion

Browse cluster: OCaml incremental computation and PPX tooling
89commits
7contributors
3languages

Tech stack & purpose

ppx_custom_printf is a ppx rewriter for OCaml that extends printf-style format strings to support user-defined string conversion functions. Rather than introducing new syntax, it repurposes the `!` operator on format strings to enable specifiers like `%{Time}` that automatically call corresponding `to_string` functions (in this case `Time.to_string`). The tool also supports S-expression conversion via `%{sexp:<type>}` syntax and allows specification of custom conversion functions beyond the default `to_string`. The project appears to be built for the OCaml ecosystem and integrates with Sexplib for S-expression support.

Languages

OCaml
98.3%
Makefile
1.6%
Dune
0.1%

Contributors