Pprintast(3) OCaml library Pprintast(3)

# [NAME](#NAME)

Pprintast - Pretty-printers for Parsetree

# [Module](#Module)

Module Pprintast

# [Documentation](#Documentation)

Module **Pprintast**  
: **sig end**

Pretty-printers for **Parsetree**

Warning: this module is unstable and part of **Compiler\_libs** .

*type space\_formatter* = **(unit, Format.formatter, unit) format**

*val longident* : **Format.formatter -&gt; Longident.t -&gt; unit**

*val constr* : **Format.formatter -&gt; Longident.t -&gt; unit**

*val expression* : **Format.formatter -&gt; Parsetree.expression -&gt; unit**

*val string\_of\_expression* : **Parsetree.expression -&gt; string**

*val pattern* : **Format.formatter -&gt; Parsetree.pattern -&gt; unit**

*val core\_type* : **Format.formatter -&gt; Parsetree.core\_type -&gt; unit**

*val signature* : **Format.formatter -&gt; Parsetree.signature -&gt; unit**

*val structure* : **Format.formatter -&gt; Parsetree.structure -&gt; unit**

*val string\_of\_structure* : **Parsetree.structure -&gt; string**

*val module\_expr* : **Format.formatter -&gt; Parsetree.module\_expr -&gt; unit**

*val toplevel\_phrase* : **Format.formatter -&gt; Parsetree.toplevel\_phrase -&gt; unit**

*val top\_phrase* : **Format.formatter -&gt; Parsetree.toplevel\_phrase -&gt; unit**

*val class\_field* : **Format.formatter -&gt; Parsetree.class\_field -&gt; unit**

*val class\_type\_field* : **Format.formatter -&gt; Parsetree.class\_type\_field -&gt; unit**

*val class\_expr* : **Format.formatter -&gt; Parsetree.class\_expr -&gt; unit**

*val class\_type* : **Format.formatter -&gt; Parsetree.class\_type -&gt; unit**

*val module\_type* : **Format.formatter -&gt; Parsetree.module\_type -&gt; unit**

*val structure\_item* : **Format.formatter -&gt; Parsetree.structure\_item -&gt; unit**

*val signature\_item* : **Format.formatter -&gt; Parsetree.signature\_item -&gt; unit**

*val binding* : **Format.formatter -&gt; Parsetree.value\_binding -&gt; unit**

*val payload* : **Format.formatter -&gt; Parsetree.payload -&gt; unit**

*val tyvar\_of\_name* : **string -&gt; string**

Turn a type variable name into a valid identifier, taking care of the special treatment required for the single quote character in second position, or for keywords by escaping them with \\#. No-op on "\_".

*val tyvar* : **Format.formatter -&gt; string -&gt; unit**

Print a type variable name as a valid identifier, taking care of the special treatment required for the single quote character in second position, or for keywords by escaping them with \\#. No-op on "\_".

*module Doc :* **sig end**

**Format\_doc** functions for error messages

2026-09-04 OCamldoc

---

Document: Pprintast(3o) from ocaml 5.5.1-r0 (Chainguard OS)
Source: https://github.com/ocaml/ocaml
