package octez-libs

  1. Overview
  2. Docs
A package that contains multiple base libraries used by the Octez suite

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65

doc/octez-libs.stdlib/Tezos_stdlib/Tag/index.html

Module Tezos_stdlib.TagSource

Tags and tag sets. Tags are basically similar to a plain extensible variant type, but wrapped with metadata that enables them to be printed generically and combined into tag sets where each tag is either not present or associated with a specific value.

They are primarily intended for use with the `Logging` module but it would probably be reasonable to use them for other purposes.

Sourcetype _ def

Type of tag definitions. Analogous to a constructor of an extensible variant type, but first-class.

Sourceval def : ?doc:string -> string -> (Format.formatter -> 'a -> unit) -> 'a def

Define a new tag with a name, printer, and optional documentation string. This is generative, not applicative, so tag definitions created with identical names and printers at different times or places will be different tags! You probably do not want to define a tag in a local scope unless you have something really tricky in mind. Basically all the caveats you would have if you wrote type t += apply.

Sourceval name : 'a def -> string
Sourceval doc : 'a def -> string
Sourceval printer : 'a def -> Format.formatter -> 'a -> unit
Sourceval pp_def : Format.formatter -> 'a def -> unit

Print the name of a tag definition.

Sourcetype t =
  1. | V : 'a def * 'a -> t

A binding consisting of a tag and value. If a `def` is a constructor of an extensible variant type, a `t` is a value of that type.

Sourceval pp : Format.formatter -> t -> unit
Sourcemodule Key : sig ... end
Sourcetype set

Tag sets. If `t` is an extensible variant type, `set` is a set of `t`s no two of which have the same constructor. Most ordinary set and map operations familiar from the OCaml standard library are provided. `equal` and `compare` are purposely not provided as there is no meaningful ordering on tags and their arguments may not even have a meaningful notion of equality.

Sourceval empty : set
Sourceval is_empty : set -> bool
Sourceval mem : 'a def -> set -> bool
Sourceval add : 'a def -> 'a -> set -> set
Sourceval update : 'a def -> ('a option -> 'a option) -> set -> set
Sourceval singleton : 'a def -> 'a -> set
Sourceval remove : 'a def -> set -> set
Sourceval rem : 'a def -> set -> set
Sourcetype merger = {
  1. merger : 'a. 'a def -> 'a option -> 'a option -> 'a option;
}
Sourceval merge : merger -> set -> set -> set
Sourcetype unioner = {
  1. unioner : 'a. 'a def -> 'a -> 'a -> 'a;
}
Sourceval union : unioner -> set -> set -> set
Sourceval iter : (t -> unit) -> set -> unit
Sourceval fold : (t -> 'b -> 'b) -> set -> 'b -> 'b
Sourceval for_all : (t -> bool) -> set -> bool
Sourceval exists : (t -> bool) -> set -> bool
Sourceval filter : (t -> bool) -> set -> set
Sourceval partition : (t -> bool) -> set -> set * set
Sourceval cardinal : set -> int
Sourceval min_binding : set -> t
Sourceval min_binding_opt : set -> t option
Sourceval max_binding : set -> t
Sourceval max_binding_opt : set -> t option
Sourceval choose : set -> t
Sourceval choose_opt : set -> t option
Sourceval split : 'a def -> set -> set * 'a option * set
Sourceval find_opt : 'a def -> set -> 'a option
Sourceval find : 'a def -> set -> 'a option
Sourceval get : 'a def -> set -> 'a
Sourceval find_first : (Key.t -> bool) -> set -> t
Sourceval find_first_opt : (Key.t -> bool) -> set -> t option
Sourceval find_last : (Key.t -> bool) -> set -> t
Sourceval find_last_opt : (Key.t -> bool) -> set -> t option
Sourceval map : (t -> t) -> set -> set
Sourceval mapi : (t -> t) -> set -> set
Sourceval pp_set : Format.formatter -> set -> unit
Sourcemodule DSL : sig ... end

DSL for logging messages. Opening this locally makes it easy to supply a number of semantic tags for a log event while using their values in the human-readable text. For example:

OCaml

Innovation. Community. Security.