20002018 Ericsson AB. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. sets Robert Virding Bjarne Däcker 1 Bjarne Däcker 1999-07-27 A sets.xml
sets Functions for set manipulation.

Sets are collections of elements with no duplicate elements. The representation of a set is undefined.

This module provides the same interface as the ordsets(3) module but with an undefined representation. One difference is that while this module considers two elements as different if they do not match (=:=), ordsets considers two elements as different if and only if they do not compare equal (==).

As returned by new/0.

Add an element to a Set.

Returns a new set formed from Set1 with Element inserted.

Remove an element from a Set.

Returns Set1, but with Element removed.

Filter set elements.

Filters elements in Set1 with boolean function Pred.

Fold over set elements.

Folds Function over every element in Set and returns the final value of the accumulator. The evaluation order is undefined.

Convert a list into a Set.

Returns a set of the elements in List.

Return the intersection of a list of Sets.

Returns the intersection of the non-empty list of sets.

Return the intersection of two Sets.

Returns the intersection of Set1 and Set2.

Check whether two Sets are disjoint.

Returns true if Set1 and Set2 are disjoint (have no elements in common), otherwise false.

Test for membership of a Set.

Returns true if Element is an element of Set, otherwise false.

Test for empty set.

Returns true if Set is an empty set, otherwise false.

Test for a Set.

Returns true if Set is a set of elements, otherwise false.

Test for subset.

Returns true when every element of Set1 is also a member of Set2, otherwise false.

Return an empty set.

Returns a new empty set.

Return the number of elements in a set.

Returns the number of elements in Set.

Return the difference of two Sets.

Returns only the elements of Set1 that are not also elements of Set2.

Convert a Setinto a list.

Returns the elements of Set as a list. The order of the returned elements is undefined.

Return the union of a list of Sets.

Returns the merged (union) set of the list of sets.

Return the union of two Sets.

Returns the merged (union) set of Set1 and Set2.

See Also

gb_sets(3), ordsets(3)