Map_S.WithForeign
Combination with other kinds of maps.
Like filter_map_no_share
, but takes another map.
type ('value, 'map2) polyinter_foreign = {
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 = {
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 = {
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