= 1024" x-on:close-sidebar="sidebar=window.innerWidth >= 1024 && true">
package containers
-
containers
-
containers.data
-
containers.monomorphic
-
containers.sexp
-
containers.top
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
val empty : t
val is_empty : t -> bool
add_mult set x n
adds n
occurrences of x
to set
.
- raises Invalid_argument
if
n < 0
.
- since 0.6
remove_mult set x n
removes at most n
occurrences of x
from set
.
- raises Invalid_argument
if
n < 0
.
- since 0.6
update set x f
calls f n
where n
is the current multiplicity of x
in set
(0
to indicate its absence); the result of f n
is the new multiplicity of x
.
- raises Invalid_argument
if
f n < 0
.
- since 0.6
union a b
contains as many occurrences of an element x
as count a x + count b x
.
meet a b
is a multiset such that count (meet a b) x = max (count a x) (count b x)
.
intersection a b
is a multiset such that count (intersection a b) x = min (count a x) (count b x)
.
val cardinal : t -> int
Number of distinct elements.