package containers-data

  1. Overview
  2. Docs

Imperative table indexed by Key

type t
val create : ?size:int -> unit -> t
val mem : t -> _ Key.t -> bool
val add : t -> 'a Key.t -> 'a -> unit
val remove : t -> _ Key.t -> unit
val length : t -> int
val find : t -> 'a Key.t -> 'a option
val clear : t -> unit

clear the table (like Hashtbl.clear)

  • since 3.11
val reset : t -> unit

reset the table (like Hashtbl.reset)

  • since 3.11
val find_exn : t -> 'a Key.t -> 'a
  • raises Not_found

    if the key is not in the table.

val iter : (pair -> unit) -> t -> unit
val to_iter : t -> pair iter
val of_iter : pair iter -> t
val add_iter : t -> pair iter -> unit
val add_list : t -> pair list -> unit
val of_list : pair list -> t
val to_list : t -> pair list
OCaml

Innovation. Community. Security.