Module type Prime_map.S

include Stdlib.Map.S
type key
type +'a t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val update : key -> ('a option -> 'a option) -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t
val union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val min_binding_opt : 'a t -> (key * 'a) option
val max_binding : 'a t -> key * 'a
val max_binding_opt : 'a t -> (key * 'a) option
val choose : 'a t -> key * 'a
val choose_opt : 'a t -> (key * 'a) option
val split : key -> 'a t -> 'a t * 'a option * 'a t
val find : key -> 'a t -> 'a
val find_opt : key -> 'a t -> 'a option
val find_first : (key -> bool) -> 'a t -> key * 'a
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
val find_last : (key -> bool) -> 'a t -> key * 'a
val find_last_opt : (key -> bool) -> 'a t -> (key * 'a) option
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_from : key -> 'a t -> (key * 'a) Stdlib.Seq.t
val add_seq : (key * 'a) Stdlib.Seq.t -> 'a t -> 'a t
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
val app : 'a t -> key -> 'a option

app m is the partial function corresponding to m.

val pop : key -> 'a t -> ('a * 'a t) option

pop k m returns Some (find k m, remove k m) if k is bound in m, otherwise None.

search f m returns the first non-None result of f k v where k, v runs over the bindings of m if it exists, otherwise None.

val fold2t : (key -> 'a -> 'b -> 'c -> 'c) -> 'a t -> 'b t -> 'c -> 'c

fold2t f m0 m1 returns the composition f kₙ vₙ wₙ ∘ ⋯ ∘ f k₁ v₁ w₁ where k₁, …, kₙ are the coinciding indices of m0 and m1, and v₁, …, vₙ and w₁, …, wₙ are the correspoding values from m0 and m1, respectively.

val map2t : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

map2t f m0 m1 returns a map which contains a mapping from k to f x0 x1 for each k, x0, and x1 such that m0 maps k to x0 and m1 maps k to x1.

val mapi2t : (key -> 'a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

mapi2t f m0 m1 returns a map which contains a mapping from k to f k x0 x1 for each k, x0, and x1 such that m0 maps k to x0 and m1 maps k to x1.

val left_union : 'a t -> 'a t -> 'a t

left_union m0 m1 is the map whose domain is the union of the domains of m0 and m1 and whose values agree with m0 where present and m1 elsewhere.

val split_union : (key -> 'a -> 'b -> 'c) -> 'a t -> 'b t -> 'a t * 'b t * 'c t

split_union mA mB is a triple (mA', mB', mC') where mA' and mB' are the respective bindings of mA and mB which have disjoint keys, and mC' has a binding (k, f k a b) for each pair of bindings (k, a) of mA and (k, b) of mB sharing k.

val left_inter : 'a t -> 'b t -> 'a t
deprecated

Use mapi2t fst.

val compl : 'a t -> 'a t -> 'a t

compl mN mP is the complement of mN relative to mP.