package containers

  1. Overview
  2. Docs

Parameters

module X : HASHABLE

Signature

type key = X.t
type 'a t
val create : int -> 'a t

Create a new table of the given initial capacity

val mem : 'a t -> key -> bool

mem tbl k returns true iff k is mapped to some value in tbl

val find : 'a t -> key -> 'a option
val find_exn : 'a t -> key -> 'a
val get : key -> 'a t -> 'a option

get k tbl recovers the value for k in tbl, or returns None if k doesn't belong

val get_exn : key -> 'a t -> 'a
val add : 'a t -> key -> 'a -> unit

add tbl k v adds k -> v to tbl, possibly replacing the old value associated with k.

val remove : 'a t -> key -> unit

Remove binding

val size : _ t -> int

Number of bindings

val of_list : (key * 'a) list -> 'a t
val to_list : 'a t -> (key * 'a) list
val of_seq : (key * 'a) sequence -> 'a t
val to_seq : 'a t -> (key * 'a) sequence
val keys : _ t -> key sequence
val values : 'a t -> 'a sequence
OCaml

Innovation. Community. Security.