Ast_helper.Te(3)
π Ast_helper.Te(3) β like, the OCaml library one, bestie
okay so this is a page from the OCaml library manual (yes, that manual), section 3, and it's about type extensions. no cap, that's the whole vibe. let's get into it π¦
β¨ NAME β¨
Ast_helper.Te β Type extensions π
like, literally the type-extensions helper module. that's her. that's the whole job description.
π Module π
Module Ast_helper.Te
she's a module. she has one job. iykyk.
π Documentation π
Module Te
: sig end
so yeah, it's a module signature, and the doc page is just⦠the contents. iconic behaviour honestly.
Type extensions β¨ β that's the tagline, that's the brand.
πΈ the vals, in order, do not skip, i am begging
val mkβ takes?loc:Ast_helper.loc,?attrs:Ast_helper.attrs,?docs:Docstrings.docs,?params:(Parsetree.core_type * (Asttypes.variance * Asttypes.injectivity)) list,?priv:Asttypes.private_flag, anAst_helper.lid, and aParsetree.extension_constructor listβ and hands you back aParsetree.type_extension. every arg optional except thelidand the constructor list, main character energy fr.
val mk : ?loc:Ast_helper.loc -> ?attrs:Ast_helper.attrs ->
?docs:Docstrings.docs -> ?params:(Parsetree.core_type *
(Asttypes.variance * Asttypes.injectivity)) list ->
?priv:Asttypes.private_flag -> Ast_helper.lid ->
Parsetree.extension_constructor list -> Parsetree.type_extension
val mk_exceptionβ the exception-flavoured one π«Ά. takes?loc:Ast_helper.loc,?attrs:Ast_helper.attrs,?docs:Docstrings.docs, plus oneParsetree.extension_constructor, and gives you aParsetree.type_exception. yes bestie, exceptions get their own lil entry point.
val mk_exception : ?loc:Ast_helper.loc -> ?attrs:Ast_helper.attrs ->
?docs:Docstrings.docs -> Parsetree.extension_constructor ->
Parsetree.type_exception
val constructorβ builds aParsetree.extension_constructorfor you π . options are?loc:Ast_helper.loc,?attrs:Ast_helper.attrs,?docs:Docstrings.docs,?info:Docstrings.info, then the requiredAst_helper.strand aParsetree.extension_constructor_kind.
val constructor : ?loc:Ast_helper.loc -> ?attrs:Ast_helper.attrs ->
?docs:Docstrings.docs -> ?info:Docstrings.info -> Ast_helper.str ->
Parsetree.extension_constructor_kind -> Parsetree.extension_constructor
val declβ also returns aParsetree.extension_constructor, but this one's got so many optionals, she's highkey the most dressed-up val here π. you've got?loc:Ast_helper.loc,?attrs:Ast_helper.attrs,?docs:Docstrings.docs,?info:Docstrings.info,?vars:Ast_helper.str list,?args:Parsetree.constructor_arguments,?res:Parsetree.core_type, and then the requiredAst_helper.str.
val decl : ?loc:Ast_helper.loc -> ?attrs:Ast_helper.attrs ->
?docs:Docstrings.docs -> ?info:Docstrings.info -> ?vars:Ast_helper.str
list -> ?args:Parsetree.constructor_arguments ->
?res:Parsetree.core_type -> Ast_helper.str ->
Parsetree.extension_constructor
val rebindβ the re-export girlie π§. takes?loc:Ast_helper.loc,?attrs:Ast_helper.attrs,?docs:Docstrings.docs,?info:Docstrings.info, then anAst_helper.strand anAst_helper.lid, and returns aParsetree.extension_constructor.
val rebind : ?loc:Ast_helper.loc -> ?attrs:Ast_helper.attrs ->
?docs:Docstrings.docs -> ?info:Docstrings.info -> Ast_helper.str ->
Ast_helper.lid -> Parsetree.extension_constructor
quick vibe check: every single one of these has?loc,?attrsand?docshanging out as optionals. that's not me being lazy, that's just the truth. and?info:Docstrings.infoshows up onconstructor,declandrebindbut not onmkormk_exceptionβ noticed that? slay, now you'll never unsee it π
π the cute sign-off π
this page was brought to you by OCamldoc, dated 2026-06-22, living in section Ast_helper.Te(3) of the OCaml library manual. stan the tooling, drink some water, go write a type extension. periodt. βπ₯
π¦ where this page comes from
- arch rolling: ocaml 5.5.0-1 Β· LGPL2.1 AND custom: QPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms