package ppxlib_jane

  1. Overview
  2. Docs
Utilities for working with Jane Street AST constructs

Install

Dune Dependency

Authors

Maintainers

Sources

v0.17.1.tar.gz
md5=4a9361efc1ee6d099bf6857bbe96e2fb
sha512=3aacf2b8c01ca45ac3c1e51119fe0cc222739cad4c4def3fbc682aa2f30c35f3e5a91c5e7c859e41cdcce4c52f2f3c2711e6163e0f893cc398e07ce51c2c6265

doc/README.html

'ppxlib_jane'

A library for use in ppxes for constructing and matching on ASTs corresponding to the augmented parsetree that is recognized by the Jane Street OCaml compiler.

ASTs constructed using this library are compatible with the standard OCaml compiler. Any syntax change known to this library is encoded as attributes, and the standard OCaml compiler's interpretation of the ASTs constructed by these library (which amounts to ignoring the attributes) is reasonable. That is, we only expose "unsurprising" things in this library. For example, if you construct an n-ary function using this library, the standard OCaml compiler will interpret it as n nested unary functions in the normal way.

Likewise, ppxes that use this library to match on Jane Street ASTs can also be used with the standard OCaml compiler. (The Jane Street AST cases of the match will just never be triggered when using the standard OCaml compiler.)

This is how we intend this library to fit into the broader ppx ecosystem:

+-------------+       +--------------+      +------------------+
|             |       |              |      |                  |
|    ppxes    +------>|    ppxlib    +----->+ compiler libs,   |
|             |       |              |      | ppxlib_ast, etc. |
+------+------+       +--------------+      |                  |
       |                                    +---------+--------+
       |              +---------------+               ^
       |              |               |               |
       +------------->+  ppxlib_jane  +---------------+
                      |               |
                      +---------------+

That is, there is no dependency between ppxlib and ppxlib_jane, and ppx authors are free to use ppxlib_jane if they want to construct AST nodes recognized by the Jane Street OCaml compiler.

OCaml

Innovation. Community. Security.