---
name: "Ast_helper.Typ"
section: "3o"
platform: "linux"
package: "ocaml"
version: "5.5.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Ast_helper.Typ"
---

# Ast\_helper.Typ(3o)

Type expressions

## NAME

Ast\_helper.Typ - Type expressions

## Module

Module   Ast\_helper.Typ

## Documentation

Module **Typ**\
  :  **sig end**

Type expressions

*val mk* :  **?loc:Ast\_helper.loc -\>** **?attrs:Ast\_helper.attrs -\> Parsetree.core\_type\_desc -\> Parsetree.core\_type**

*val attr* :  **Parsetree.core\_type -\> Parsetree.attribute -\> Parsetree.core\_type**

*val any* :  **?loc:Ast\_helper.loc -\> ?attrs:Ast\_helper.attrs -\> unit -\> Parsetree.core\_type**

*val var* :  **?loc:Ast\_helper.loc -\>** **?attrs:Ast\_helper.attrs -\> string -\> Parsetree.core\_type**

*val arrow* :  **?loc:Ast\_helper.loc -\>** **?attrs:Ast\_helper.attrs -\>** **Asttypes.arg\_label -\>** **Parsetree.core\_type -\> Parsetree.core\_type -\> Parsetree.core\_type**

*val tuple* :  **?loc:Ast\_helper.loc -\>** **?attrs:Ast\_helper.attrs -\>** **(string option \* Parsetree.core\_type) list -\> Parsetree.core\_type**

*val constr* :  **?loc:Ast\_helper.loc -\>** **?attrs:Ast\_helper.attrs -\>** **Ast\_helper.lid -\> Parsetree.core\_type list -\> Parsetree.core\_type**

*val object\_* :  **?loc:Ast\_helper.loc -\>** **?attrs:Ast\_helper.attrs -\>** **Parsetree.object\_field list -\> Asttypes.closed\_flag -\> Parsetree.core\_type**

*val class\_* :  **?loc:Ast\_helper.loc -\>** **?attrs:Ast\_helper.attrs -\>** **Ast\_helper.lid -\> Parsetree.core\_type list -\> Parsetree.core\_type**

*val alias* :  **?loc:Ast\_helper.loc -\>** **?attrs:Ast\_helper.attrs -\>** **Parsetree.core\_type -\> string Ast\_helper.with\_loc -\> Parsetree.core\_type**

*val variant* :  **?loc:Ast\_helper.loc -\>** **?attrs:Ast\_helper.attrs -\>** **Parsetree.row\_field list -\>** **Asttypes.closed\_flag -\> Asttypes.label list option -\> Parsetree.core\_type**

*val poly* :  **?loc:Ast\_helper.loc -\>** **?attrs:Ast\_helper.attrs -\>** **Ast\_helper.str list -\> Parsetree.core\_type -\> Parsetree.core\_type**

*val package* :  **?loc:Ast\_helper.loc -\>** **?attrs:Ast\_helper.attrs -\> Parsetree.package\_type -\> Parsetree.core\_type**

*val open\_* :  **?loc:Ast\_helper.loc -\>** **?attrs:Ast\_helper.attrs -\>** **Ast\_helper.lid -\> Parsetree.core\_type -\> Parsetree.core\_type**

*val extension* :  **?loc:Ast\_helper.loc -\>** **?attrs:Ast\_helper.attrs -\> Parsetree.extension -\> Parsetree.core\_type**

*val functor\_* :  **?loc:Ast\_helper.loc -\>** **?attrs:Ast\_helper.attrs -\>** **Asttypes.arg\_label -\>** **Ast\_helper.str -\>** **Parsetree.package\_type -\> Parsetree.core\_type -\> Parsetree.core\_type**

*val force\_poly* :  **Parsetree.core\_type -\> Parsetree.core\_type**

*val varify\_constructors* :  **Ast\_helper.str list -\> Parsetree.core\_type -\> Parsetree.core\_type**

**varify\_constructors newtypes te** is type expression  **te** , of which any of nullary type constructor  **tc** is replaced by type variable of the same name, if  **tc** 's name appears in  **newtypes** . Raise  **Syntaxerr.Variable\_in\_scope** if any type variable inside  **te** appears in  **newtypes** .

**Since** 4.05

*val package\_type* :  **?loc:Ast\_helper.loc -\>** **?attrs:Ast\_helper.attrs -\>** **Ast\_helper.lid -\>** **(Ast\_helper.lid \* Parsetree.core\_type) list -\> Parsetree.package\_type**

**Since** 5.4
