A convenient version of Make
that take a TOTAL_ORD
instead of
a partially ordered module.
It allow to directly pass modules that implement compare
without implementing leq
explicitly
Extract and return the minimum element, and the new heap (without
this element), or None
if the heap is empty.
Delete one occurrence of a value if it exist in the heap.
delete_one eq x h
, use eq
to find one x
in h
and delete it.
If h
do not contain x
then it return h
.
Delete all occurrences of a value in the heap.
delete_all eq x h
, use eq
to find all x
in h
and delete them.
If h
do not contain x
then it return h
.
The difference with filter is that delete_all
stops as soon as
it enters a subtree whose root is bigger than the element.
The interface of of_gen
, of_seq
, of_klist
has changed since 0.16 (the old signatures
are now add_seq
, add_gen
, add_klist
).