Up

module Packed_map

: sig

A packed map is a map from keys to values, represented using a packed array of key-value tuples which is sorted by key. Construction is very slow, but lookup is a reasonable speed. The main purpose is to be able to construct very large lookup tables that don't have much GC overhead.

#
module type Key = sig
#
type t
include Core.Std.Comparable.S with type t := t
#
module Packed_array : Packed_array.S with type elt := t
#
val bin_t : t Core.Std.Bin_prot.Type_class.t
#
val bin_read_t : t Core.Std.Bin_prot.Read.reader
#
val __bin_read_t__ : (int -> t) Core.Std.Bin_prot.Read.reader
#
val bin_reader_t : t Core.Std.Bin_prot.Type_class.reader
#
val bin_size_t : t Core.Std.Bin_prot.Size.sizer
#
val bin_write_t : t Core.Std.Bin_prot.Write.writer
#
val bin_writer_t : t Core.Std.Bin_prot.Type_class.writer
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
end
#
module type Value = sig
#
type t
#
module Packed_array : Packed_array.S with type elt := t
#
val bin_t : t Core.Std.Bin_prot.Type_class.t
#
val bin_read_t : t Core.Std.Bin_prot.Read.reader
#
val __bin_read_t__ : (int -> t) Core.Std.Bin_prot.Read.reader
#
val bin_reader_t : t Core.Std.Bin_prot.Type_class.reader
#
val bin_size_t : t Core.Std.Bin_prot.Size.sizer
#
val bin_write_t : t Core.Std.Bin_prot.Write.writer
#
val bin_writer_t : t Core.Std.Bin_prot.Type_class.writer
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
end
#
module type S = sig
#
type t
#
type key
#
type value
#
val empty : t
#
val of_alist : (key * value) list -> t
#
val to_alist : t -> (key * value) list
#
val of_aarray : (key * value) array -> t
#
val of_sorted_aarray : (key * value) array -> t
#
val of_hashtbl : (key, value) Core.Std.Hashtbl.t -> t
#
val find : t -> key -> value option
#
val mem : t -> key -> bool
#
val iter : t -> f:(key:key -> data:value -> unit) -> unit
#
val fold : t -> init:'acc -> f:(key:key -> data:value -> 'acc -> 'acc) -> 'acc
#
val bin_t : t Core.Std.Bin_prot.Type_class.t
#
val bin_read_t : t Core.Std.Bin_prot.Read.reader
#
val __bin_read_t__ : (int -> t) Core.Std.Bin_prot.Read.reader
#
val bin_reader_t : t Core.Std.Bin_prot.Type_class.reader
#
val bin_size_t : t Core.Std.Bin_prot.Size.sizer
#
val bin_write_t : t Core.Std.Bin_prot.Write.writer
#
val bin_writer_t : t Core.Std.Bin_prot.Type_class.writer
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
#
val bin_key : key Core.Std.Bin_prot.Type_class.t
#
val bin_read_key : key Core.Std.Bin_prot.Read.reader
#
val __bin_read_key__ : (int -> key) Core.Std.Bin_prot.Read.reader
#
val bin_reader_key : key Core.Std.Bin_prot.Type_class.reader
#
val bin_size_key : key Core.Std.Bin_prot.Size.sizer
#
val bin_write_key : key Core.Std.Bin_prot.Write.writer
#
val bin_writer_key : key Core.Std.Bin_prot.Type_class.writer
#
val key_of_sexp : Sexplib.Sexp.t -> key
#
val sexp_of_key : key -> Sexplib.Sexp.t
#
val bin_value : value Core.Std.Bin_prot.Type_class.t
#
val bin_read_value : value Core.Std.Bin_prot.Read.reader
#
val __bin_read_value__ : (int -> value) Core.Std.Bin_prot.Read.reader
#
val bin_reader_value : value Core.Std.Bin_prot.Type_class.reader
#
val bin_size_value : value Core.Std.Bin_prot.Size.sizer
#
val bin_write_value : value Core.Std.Bin_prot.Write.writer
#
val bin_writer_value : value Core.Std.Bin_prot.Type_class.writer
#
val value_of_sexp : Sexplib.Sexp.t -> value
#
val sexp_of_value : value -> Sexplib.Sexp.t
end
#
module Make : functor (K : Key) -> functor (V : Value) -> S with type key := K.t and type value := V.t
end