From 229d0d8ca88bc344bed89e46541b325c1d267996 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Fri, 6 May 2011 15:58:09 +0200 Subject: r Use Erlang specs and types for documentation --- lib/stdlib/doc/src/sets.xml | 153 +++++++++++++------------------------------- 1 file changed, 46 insertions(+), 107 deletions(-) (limited to 'lib/stdlib/doc/src/sets.xml') diff --git a/lib/stdlib/doc/src/sets.xml b/lib/stdlib/doc/src/sets.xml index 3610bb0184..071ee437cb 100644 --- a/lib/stdlib/doc/src/sets.xml +++ b/lib/stdlib/doc/src/sets.xml @@ -4,7 +4,7 @@
- 20002009 + 20002011 Ericsson AB. All Rights Reserved. @@ -43,202 +43,141 @@ different if and only if they do not compare equal (==).

-
- DATA TYPES - -set() - as returned by new/0 -
+ + + set() +

As returned by new/0.

+
+
- new() -> Set + Return an empty set - - Set = set() -

Returns a new empty set.

- is_set(Set) -> bool() + Test for an Set - - Set = term() - -

Returns true if Set is a set of +

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

- size(Set) -> int() + Return the number of elements in a set - - Set = term() - -

Returns the number of elements in Set.

+

Returns the number of elements in Set.

- to_list(Set) -> List + Convert an Setinto a list - - Set = set() - List = [term()] - -

Returns the elements of Set as a list.

+

Returns the elements of Set as a list.

- from_list(List) -> Set + Convert a list into an Set - - List = [term()] - Set = set() - -

Returns an set of the elements in List.

+

Returns an set of the elements in List.

- is_element(Element, Set) -> bool() + Test for membership of an Set - - Element = term() - Set = set() - -

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

+

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

- add_element(Element, Set1) -> Set2 + Add an element to an Set - - Element = term() - Set1 = Set2 = set() - -

Returns a new set formed from Set1 with - Element inserted.

+

Returns a new set formed from Set1 with + Element inserted.

- del_element(Element, Set1) -> Set2 + Remove an element from an Set - - Element = term() - Set1 = Set2 = set() - -

Returns Set1, but with Element removed.

+

Returns Set1, but with Element removed.

- union(Set1, Set2) -> Set3 + Return the union of two Sets - - Set1 = Set2 = Set3 = set() - -

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

+

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

- union(SetList) -> Set + Return the union of a list of Sets - - SetList = [set()] - Set = set() -

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

- intersection(Set1, Set2) -> Set3 + Return the intersection of two Sets - - Set1 = Set2 = Set3 = set() - -

Returns the intersection of Set1 and - Set2.

+

Returns the intersection of Set1 and + Set2.

- intersection(SetList) -> Set + Return the intersection of a list of Sets - - SetList = [set()] - Set = set() -

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

- is_disjoint(Set1, Set2) -> bool() + Check whether two Sets are disjoint - - Set1 = Set2 = set() - -

Returns true if Set1 and - Set2 are disjoint (have no elements in common), +

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

- subtract(Set1, Set2) -> Set3 + Return the difference of two Sets - - Set1 = Set2 = Set3 = set() - -

Returns only the elements of Set1 which are not - also elements of Set2.

+

Returns only the elements of Set1 which are not + also elements of Set2.

- is_subset(Set1, Set2) -> bool() + Test for subset - - Set1 = Set2 = set() - -

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

+

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

- fold(Function, Acc0, Set) -> Acc1 + Fold over set elements - - Function = fun (E, AccIn) -> AccOut - Acc0 = Acc1 = AccIn = AccOut = term() - Set = set() - -

Fold Function over every element in Set +

Fold Function over every element in Set returning the final value of the accumulator.

- filter(Pred, Set1) -> Set2 + Filter set elements - - Pred = fun (E) -> bool() - Set1 = Set2 = set() - -

Filter elements in Set1 with boolean function - Fun.

+

Filter elements in Set1 with boolean function + Pred.

-- cgit v1.2.3