Module String_dictSource

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.

Sourcetype 'a t
Sourceval compare : ('a -> 'a -> Base.int) -> 'a t -> 'a t -> Base.int
Sourceval sexp_of_t : ('a -> Base.Sexp.t) -> 'a t -> Base.Sexp.t

We don't use [@@deriving sexp], to avoid a circular dependency.

Sourceval t_of_sexp : (Base.Sexp.t -> 'a) -> Base.Sexp.t -> 'a t
Sourceval of_alist : (Base.string * 'a) Base.list -> ('a t, Base.string) Caml.result

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

Sourceval of_alist_exn : (Base.string * 'a) Base.list -> 'a t
Sourceval find : 'a t -> Base.string -> 'a Base.option
Sourceval find_exn : 'a t -> Base.string -> 'a
Sourceval to_alist : 'a t -> (Base.string * 'a) Base.list