Ast\_helper(3) OCaml library Ast\_helper(3)

# [NAME](#NAME)

Ast\_helper - Helpers to produce Parsetree fragments

# [Module](#Module)

Module Ast\_helper

# [Documentation](#Documentation)

Module **Ast\_helper**  
: **sig end**

Helpers to produce Parsetree fragments

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

*type* **'a** *with\_loc* = **'a Location.loc**

*type loc* = **Location.t**

*type lid* = **Longident.t with\_loc**

*type str* = **string with\_loc**

*type str\_opt* = **string option with\_loc**

*type attrs* = **Parsetree.attribute list**

## [Default locations](#Default_locations)

*val default\_loc* : **loc ref**

Default value for all optional location arguments.

*val with\_default\_loc* : **loc -&gt; (unit -&gt; 'a) -&gt; 'a**

Set the **default\_loc** within the scope of the execution of the provided function.

## [Constants](#Constants)

*module Const :* **sig end**

*module Attr :* **sig end**

## [Attributes](#Attributes)

## [Core language](#Core_language)

*module Typ :* **sig end**

Type expressions

*module Pat :* **sig end**

Patterns

*module Exp :* **sig end**

Expressions

*module Val :* **sig end**

Value declarations

*module Type :* **sig end**

Type declarations

*module Te :* **sig end**

Type extensions

## [Module language](#Module_language)

*module Mty :* **sig end**

Module type expressions

*module Mod :* **sig end**

Module expressions

*module Sig :* **sig end**

Signature items

*module Str :* **sig end**

Structure items

*module Md :* **sig end**

Module declarations

*module Ms :* **sig end**

Module substitutions

*module Mtd :* **sig end**

Module type declarations

*module Mb :* **sig end**

Module bindings

*module Opn :* **sig end**

Opens

*module Incl :* **sig end**

Includes

*module Vb :* **sig end**

Value bindings

## [Class language](#Class_language)

*module Cty :* **sig end**

Class type expressions

*module Ctf :* **sig end**

Class type fields

*module Cl :* **sig end**

Class expressions

*module Cf :* **sig end**

Class fields

*module Ci :* **sig end**

Classes

*module Csig :* **sig end**

Class signatures

*module Cstr :* **sig end**

Class structures

*module Rf :* **sig end**

Row fields

*module Of :* **sig end**

Object fields

2026-10-01 OCamldoc

---

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