Module Base.String_dict

Efficient static string dictionaries. By static, we mean that new key-value pairs cannot be added after the dictionary is created.

This uses the algorithm the OCaml compiler uses for pattern matching on strings.

type 'a t
include sig ... end
val compare : ('a ‑> 'a ‑> int) ‑> 'a t ‑> 'a t ‑> int
val sexp_of_t : ('a ‑> Sexp.t) ‑> 'a t ‑> Sexp.t

We don't use @@deriving_inline sexp@@@end to avoid a circular dependency

val t_of_sexp : (Sexp.t ‑> 'a) ‑> Sexp.t ‑> 'a t
val of_alist : (string * 'a) list ‑> ('a t, string) Base__.Import0.Caml.result

Creates a dictionary from an association list. It is an error for the list to contain duplicate keys.

val of_alist_exn : (string * 'a) list ‑> 'a t
val find : 'a t ‑> string ‑> 'a option
val find_exn : 'a t ‑> string ‑> 'a
val to_alist : 'a t ‑> (string * 'a) list