package lsp

  1. Overview
  2. Docs

doc/src/lsp.stdune/univ_map_intf.ml.html

Source file univ_map_intf.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# 1 "submodules/dune/otherlibs/stdune/univ_map_intf.ml"
(** Universal maps *)

module type S = sig
  (** A universal map is a map that can store values for arbitrary keys. It is
      the the key that conveys the type of the data associated to it. *)
  type t

  module Key : sig
    type 'a t

    val create : name:string -> ('a -> Dyn.t) -> 'a t
  end

  val empty : t

  val is_empty : t -> bool

  val mem : t -> 'a Key.t -> bool

  val set : t -> 'a Key.t -> 'a -> t

  val add : t -> 'a Key.t -> 'a -> (t, 'a) Result.t

  val update : t -> 'a Key.t -> f:('a option -> 'a option) -> t

  val remove : t -> 'a Key.t -> t

  val find : t -> 'a Key.t -> 'a option

  val find_exn : t -> 'a Key.t -> 'a

  val singleton : 'a Key.t -> 'a -> t

  (** [superpose a b] is [b] augmented with bindings of [a] that are not in [b]. *)
  val superpose : t -> t -> t

  val to_dyn : t -> Dyn.t

  (** [to_dyns m] is an assoc list pairing keys to (representations of) values *)
  val to_dyns : t -> (string * Dyn.t) list
end
OCaml

Innovation. Community. Security.