package metapp

  1. Overview
  2. Docs
Meta-preprocessor for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

metapp.0.4.4.tar.gz
sha512=817b33d9006a6849845e29a2b12ad7b7d13e34e38216bd2724df45e8f24356f9d281e2731ecc37a8ab2b5faef844252a04f976adf61d024b7653235e38dfdc46

doc/metapp/Metapp/index.html

Module MetappSource

include sig ... end
include sig ... end
Sourceval ppxlib_version : int * int * int
Sourceval ast_version : int * int

String constant destructor

Sourcetype string_constant = {
  1. s : string;
  2. loc : Location.t;
  3. delim : string option;
}
Sourceval destruct_string_constant : Ppxlib.constant -> string_constant option

Coercions

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

Payload construction and extraction

Sourceval int_of_payload : Ppxlib.payload -> int
Sourceval payload_of_int : int -> Ppxlib.payload
Sourceval string_of_payload : Ppxlib.payload -> string
Sourceval bool_of_payload : Ppxlib.payload -> bool

Location management

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

Longident

Sourcetype 'a comparer = 'a -> 'a -> int
Sourcemodule Longident : sig ... end
Sourceval mklid : ?prefix:Longident.t -> string -> Ast_helper.lid

Constructing function application

Sourceval nolabel : 'a -> Ppxlib.Asttypes.arg_label * 'a
Sourceval nolabels : 'a list -> (Ppxlib.Asttypes.arg_label * 'a) list
Sourceval apply : ?attrs:Ppxlib.attributes -> Ppxlib.expression -> ?labels:(string * Ppxlib.expression) list -> ?optional:(string * Ppxlib.expression) list -> Ppxlib.expression list -> Ppxlib.expression

Generic signature for visitable nodes

Sourcetype 'a iter = 'a -> unit
Sourcetype 'a map = 'a -> 'a
Sourcemodule type VisitableS = sig ... end

Generic signature for extensible nodes

Sourcetype destruct_extension = Ppxlib.extension * Ppxlib.attributes
Sourcemodule type ExtensibleS = sig ... end
Sourcemodule type PayloadS = sig ... end
Sourcemodule type ItemS = sig ... end
Sourcemodule Stri : ItemS with type t := Ppxlib.structure_item
Sourcemodule Str : sig ... end
Sourcemodule Sigi : ItemS with type t := Ppxlib.signature_item
Sourcemodule Sig : sig ... end

Module expressions

Sourcetype functor_parameter = Ppxlib.functor_parameter =
  1. | Unit
  2. | Named of string option Location.loc * Ppxlib.module_type
Sourcemodule type FunctorS = sig ... end
Sourcemodule type ModS = sig ... end
Sourcemodule Mod : ModS with type t = Ppxlib.module_expr

Module types

Sourcemodule Mty : ModS with type t = Ppxlib.module_type
Sourcemodule Types : sig ... end

Generic signature for expressions and patterns

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

Attribute management

Sourcemodule Attr : sig ... end

Module binding and declaration

Sourcetype module_name = string option
Sourceval module_name_of_string_option : string option -> module_name
Sourceval string_option_of_module_name : module_name -> string option
Sourcemodule Md : sig ... end
Sourcemodule Mb : sig ... end

Mapper for [@if bool] notation

Type construction

Sourcemodule Typ : sig ... end

Type declarations

Sourcemodule Type : sig ... end

Extension constructors

Sourcemodule Te : sig ... end

Open

Sourcemodule Opn : sig ... end

Expressions

Sourcemodule Exp : sig ... end

Row fields

Sourcemodule 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.

Object fields

Sourcemodule Of : sig ... end

With constraint

Sourcemodule With : sig ... end

General purpose functions

Sourceval compare_pair : 'a comparer -> 'b comparer -> ('a * 'b) comparer
Sourceval compare_list : 'a comparer -> 'a list comparer
Sourceval update : ('a -> 'b * 'a) -> 'a Stdcompat.ref -> 'b
Sourceval mutate : ('a -> 'a) -> 'a Stdcompat.ref -> unit
Sourceval extract_first : ('a -> 'b option) -> 'a list -> ('b * 'a list) option
Sourcemodule Accu : sig ... end

Indexed accumulator to build an array.

OCaml

Innovation. Community. Security.