ocamlbyexample
ocamlbyexample copied to clipboard
chapter: ppx
you can dump any AST by doing ocamlfind ppx_tools/dumpast your_file.ml
or ocamlfind ppx_tools/dumpast -e "1 + 1" (from https://tarides.com/blog/2019-05-09-an-introduction-to-ocaml-ppx-ecosystem)
Similarly, you can use the -t or -p options to respectively pretty print ASTs from type expressions or patterns.
(https://ocaml-ppx.github.io/ppxlib/ppxlib/manual.html#what-is-ppx)
started here: https://github.com/o1-labs/ocamlbyexample/commit/7c6a95ddc67b6dd827172e87c735a95ed97f53dc