Module tql_sets

Function Index

all/2Check if all entries of a set satisfy a predicate.
equals/2Check if 2 sets contain the same elements.
intersects/2Check if the given sets have a nonempty intersection.
is_empty/1Check if the given set is empty.
map/2Map a function over the elements of a set.
symmetric_difference/2Calculates the symmetric difference of 2 sets.

Function Details

all/2

all(Pred::fun((T) -> boolean()), Set::sets:set(T)) -> boolean()

Check if all entries of a set satisfy a predicate.

Beware vacuous truths: if the given set is empty, all entries match the predicate and the result will be true.

equals/2

equals(Set1::sets:set(T), Set2::sets:set(T)) -> boolean()

Check if 2 sets contain the same elements.

intersects/2

intersects(Set1::sets:set(T), Set2::sets:set(T)) -> boolean()

Check if the given sets have a nonempty intersection.

is_empty/1

is_empty(Set::sets:set(T::term())) -> boolean()

Check if the given set is empty.

map/2

map(Fun::fun((T1) -> T2), Set::sets:set(T1)) -> sets:set(T2)

Map a function over the elements of a set.

Note that if some of the values in the given set map to the same value, the resulting set may be smaller as it will only contain unique elements.

symmetric_difference/2

symmetric_difference(Set1::sets:set(T), Set2::sets:set(T)) -> sets:set(T)

Calculates the symmetric difference of 2 sets.

In other words, find all the elements that do not exist in both sets.


Generated by EDoc