19962018 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. ordsets Robert Virding Bjarne Däcker 1 Bjarne Däcker 1999-07-27 A ordsets.xml
ordsets Functions for manipulating sets as ordered lists.

Sets are collections of elements with no duplicate elements. An ordset is a representation of a set, where an ordered list is used to store the elements of the set. An ordered list is more efficient than an unordered list. Elements are ordered according to the Erlang term order.

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

As returned by new/0.

Add an element to an Ordset.

Returns a new ordered set formed from Ordset1 with Element inserted.

Remove an element from an Ordset.

Returns Ordset1, but with Element removed.

Filter set elements.

Filters elements in Ordset1 with boolean function Pred.

Fold over set elements.

Folds Function over every element in Ordset and returns the final value of the accumulator.

Convert a list into an Ordset.

Returns an ordered set of the elements in List.

Return the intersection of a list of Ordsets

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

Return the intersection of two Ordsets.

Returns the intersection of Ordset1 and Ordset2.

Check whether two Ordsets are disjoint.

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

Test for membership of an Ordset.

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

Test for empty set.

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

Test for an Ordset.

Returns true if Ordset is an ordered set of elements, otherwise false.

Test for subset.

Returns true when every element of Ordset1 is also a member of Ordset2, otherwise false.

Return an empty set.

Returns a new empty ordered set.

Return the number of elements in a set.

Returns the number of elements in Ordset.

Return the difference of two Ordsets.

Returns only the elements of Ordset1 that are not also elements of Ordset2.

Convert an Ordset into a list.

Returns the elements of Ordset as a list.

Return the union of a list of Ordsets.

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

Return the union of two Ordsets.

Returns the merged (union) set of Ordset1 and Ordset2.

See Also

gb_sets(3), sets(3)