create_mapped get_key get_data [x1,...,xn]
= of_alist [get_key x1, get_data x1; ...; get_key xn, get_data xn]
create_with_key ~get_key [x1,...,xn]
= of_alist [get_key x1, x1; ...; get_key xn, xn]
like filter_map
, but function takes both key and data as arguments
returns new maps with bound values partitioned by f applied to the bound values
like partition_map
, but function takes both key and data as arguments
Merge two hashtables.
The result of merge f h1 h2
has as keys the set of all k
in the
union of the sets of keys of h1
and h2
for which d(k)
is not
None, where:
d(k) =
k
in h1
is to d1, and h2
does not map k
;k
in h2
is to d2, and h1
does not map k
;k
in h1
is to d1
and k
in h2
is to d2
.Each key k
is mapped to a single piece of data x, where d(k)
= Some x.
Returns the list of all data for given hashtable.
filter_inplace t ~f
removes all the elements from t
that don't satisfy f
.
replace_all t ~f
applies f to all elements in t
, transforming them in place
filter_replace_all
combines the effects of replace_all
and filter_inplace