Module MakeCustomHomogeneous.WithForeign

Combination with other kinds of maps.

Parameters

module Map2 : BaseMap_S with type _ key = key

Signature

type ('b, 'c) polyfilter_map_foreign = {
  1. f : 'a. key -> ('a, 'b) Map2.value -> 'c option;
}

Like filter_map_no_share, but takes another map.

val filter_map_no_share : 'b Map2.t -> ('b, 'c) polyfilter_map_foreign -> 'c t
type ('value, 'map2) polyinter_foreign = {
  1. f : 'a. 'a Map2.key -> 'value -> ('a, 'map2) Map2.value -> 'value;
}

Like nonidempotent_inter, but takes another map as an argument.

val nonidempotent_inter : 'a t -> 'b Map2.t -> ('a, 'b) polyinter_foreign -> 'a t
type ('map1, 'map2) polyinsert_multiple = {
  1. f : 'a. key -> 'map1 option -> ('a, 'map2) Map2.value -> 'map1 option;
}

This is equivalent to multiple calls to insert, where the key and values would be taken from the second map, i.e. insert_multiple f m1 m2 calls f.f on every key of m2, says if the corresponding value also exists in m1, and adds or remove the element in m1 depending on the value of f.f. f.f is called in the order of Key.to_int

val insert_multiple : 'a t -> 'b Map2.t -> ('a, 'b) polyinsert_multiple -> 'a t
type ('map1, 'map2) polyremove_multiple = {
  1. f : 'a. key -> 'map1 -> ('a, 'map2) Map2.value -> 'map1 option;
}

This is equivalent to multiple calls to remove, where the key and values would be taken from the second map; i.e. remove_multiple f m1 m2 calls f.f on every binding that is in both m1 and m2, and either removes or changes it in m1. Bindings are passed to f.f in increasing order of Key.to_int.

val remove_multiple : 'a t -> 'b Map2.t -> ('a, 'b) polyremove_multiple -> 'a t