Asttypes(3)

okay so bestie, welcome to Asttypes(3) from the OCaml library manual πŸ’–. This page is about the auxiliary AST types used by parsetree and typedtree, and yes, it's giving compiler-internals main character energy.

🌸 NAME 🌸

Asttypes β€” Auxiliary AST types used by parsetree and typedtree.

πŸ¦‹ MODULE πŸ¦‹

Module: Asttypes

πŸ’– DOCUMENTATION πŸ’–

Module: Asttypes

Module Asttypes
 : sig end

Auxiliary AST types used by parsetree and typedtree.

Warning: this module is unstable and part of Compiler_libs .

Here's every type and constructor, preserved exactly, no cap:

type constant

type constant =
 | Const_int of int
 | Const_char of char
 | Const_string of string * Location.t * string option
 | Const_float of string
 | Const_int32 of int32
 | Const_int64 of int64
 | Const_nativeint of nativeint

type rec_flag

type rec_flag =
 | Nonrecursive
 | Recursive

type direction_flag

type direction_flag =
 | Upto
 | Downto

type private_flag

type private_flag =
 | Private
 | Public

type mutable_flag

type mutable_flag =
 | Immutable
 | Mutable

type atomic_flag

type atomic_flag =
 | Nonatomic
 | Atomic

type virtual_flag

type virtual_flag =
 | Virtual
 | Concrete

type override_flag

type override_flag =
 | Override
 | Fresh

type closed_flag

type closed_flag =
 | Closed
 | Open

type label = string

type label = string

type arg_label

type arg_label =
 | Nolabel
 | Labelled of string
  (* label:T -> ...

 *)
 | Optional of string
  (* ?label:T -> ...

 *)

type 'a loc

type 'a loc = 'a Location.loc = {
 txt : 'a ;
 loc : Location.t ;
 }

type variance

type variance =
 | Covariant
 | Contravariant
 | NoVariance
 | Bivariant

type injectivity

type injectivity =
 | Injective
 | NoInjectivity

val string_of_label

val string_of_label : arg_label -> string

alright bestie, that's the whole page. source/version: OCamldoc; date: 2026-06-22; header title: Asttypes(3). mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from