module Set: sig
.. end
val add : ?eq:('a -> 'a -> bool) -> 'a -> 'a CCList.t -> 'a CCList.t
add x set
adds x
to set
if it was not already present. Linear time.
Since 0.11
val remove : ?eq:('a -> 'a -> bool) -> 'a -> 'a CCList.t -> 'a CCList.t
remove x set
removes one occurrence of x
from set
. Linear time.
Since 0.11
val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a CCList.t -> bool
Membership to the list. Linear time
val subset : ?eq:('a -> 'a -> bool) -> 'a CCList.t -> 'a CCList.t -> bool
Test for inclusion
val uniq : ?eq:('a -> 'a -> bool) -> 'a CCList.t -> 'a CCList.t
List uniq. Remove duplicates w.r.t the equality predicate.
Complexity is quadratic in the length of the list, but the order
of elements is preserved. If you wish for a faster de-duplication
but do not care about the order, use
CCList.sort_uniq
val union : ?eq:('a -> 'a -> bool) -> 'a CCList.t -> 'a CCList.t -> 'a CCList.t
List union. Complexity is product of length of inputs.
val inter : ?eq:('a -> 'a -> bool) -> 'a CCList.t -> 'a CCList.t -> 'a CCList.t
List intersection. Complexity is product of length of inputs.