package metapp

  1. Overview
  2. Docs

Coercions

val int_of_expression : Parsetree.expression -> int
val string_of_expression : Parsetree.expression -> string
val string_of_arbitrary_expression : Parsetree.expression -> string
val bool_of_expression : Parsetree.expression -> bool
val list_of_expression : Parsetree.expression -> Parsetree.expression list
val list_of_tuple : Parsetree.expression -> Parsetree.expression list
val structure_of_expression : Parsetree.expression -> Parsetree.structure
val lid_of_str : Ast_helper.str -> Ast_helper.lid

Payload construction and extraction

val int_of_payload : Parsetree.payload -> int
val payload_of_int : int -> Parsetree.payload
val string_of_payload : Parsetree.payload -> string
val bool_of_payload : Parsetree.payload -> bool

Location management

val mkloc : 'a -> 'a Location.loc
val map_loc : ('a -> 'b) -> 'a Location.loc -> 'b Location.loc
val with_loc : ('a -> 'b) -> 'a Location.loc -> 'b

Constructing identifiers

val make_ident : ?prefix:Longident.t -> string -> Longident.t

Constructing function application

val nolabel : 'a -> Asttypes.arg_label * 'a
val nolabels : 'a list -> (Asttypes.arg_label * 'a) list

Generic signature for visitable nodes

type 'a iterator_item = Ast_iterator.iterator -> 'a -> unit
type 'a mapper_item = Ast_mapper.mapper -> 'a -> 'a
type ('cell, 'contents) accessor = {
  1. get : 'cell -> 'contents;
  2. set : 'contents -> 'cell -> 'cell;
}
module type VisitableS = sig ... end

Generic signature for extensible nodes

module type ExtensibleS = sig ... end
module type PayloadS = sig ... end
module type ItemS = sig ... end
module Cty : ExtensibleS with type t = Parsetree.class_type
module Cl : ExtensibleS with type t = Parsetree.class_expr
module Cf : ExtensibleS with type t = Parsetree.class_field
module Mty : ExtensibleS with type t = Parsetree.module_type
module Mod : ExtensibleS with type t = Parsetree.module_expr
module Stri : ItemS with type t := Parsetree.structure_item
module Str : sig ... end
module Sigi : ItemS with type t := Parsetree.signature_item
module Sig : sig ... end

Generic signature for expressions and patterns

module type ValueS = sig ... end
module Pat : ValueS with type t = Parsetree.pattern
type value = {
  1. exp : Parsetree.expression;
  2. pat : Parsetree.pattern;
}
module Value : ValueS with type t = value

Attribute management

module Attr : sig ... end

Module binding and declaration

module Md : sig ... end
module Mb : sig ... end

Signature type destruction

type sig_type = {
  1. id : Ident.t;
  2. decl : Types.type_declaration;
  3. rec_status : Types.rec_status;
  4. visibility : Types.visibility;
}
val destruct_sig_type : Types.signature_item -> sig_type option

Mapper for [@if bool] notation

val filter : Ast_mapper.mapper

Type construction

module Typ : sig ... end

Expressions

module Exp : sig ... end

Row fields

module Rf : sig ... end

The module `Rf` has been introduced in Ast_helper with OCaml 4.08.0 (as row_field type switched to a record representation). Moreover, even the current Ast_helper.Rf.inherit_ (OCaml 4.10.0) misses the ?attrs flag.

module Of : sig ... end

General purpose functions

val update : ('a -> 'b * 'a) -> 'a Stdcompat.ref -> 'b
val mutate : ('a -> 'a) -> 'a Stdcompat.ref -> unit
val extract_first : ('a -> 'b option) -> 'a list -> ('b * 'a list) option
OCaml

Innovation. Community. Security.