aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/doc/src/sets.xml
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2011-05-06 15:58:09 +0200
committerHans Bolinder <[email protected]>2011-05-12 08:03:42 +0200
commit229d0d8ca88bc344bed89e46541b325c1d267996 (patch)
tree74fec344df8596c868c36cec5ac08102008cacf3 /lib/stdlib/doc/src/sets.xml
parent68fe6a14539b82250373ef114d6576e74e1b8f2e (diff)
downloadotp-229d0d8ca88bc344bed89e46541b325c1d267996.tar.gz
otp-229d0d8ca88bc344bed89e46541b325c1d267996.tar.bz2
otp-229d0d8ca88bc344bed89e46541b325c1d267996.zip
r
Use Erlang specs and types for documentation
Diffstat (limited to 'lib/stdlib/doc/src/sets.xml')
-rw-r--r--lib/stdlib/doc/src/sets.xml153
1 files changed, 46 insertions, 107 deletions
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 @@
<erlref>
<header>
<copyright>
- <year>2000</year><year>2009</year>
+ <year>2000</year><year>2011</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -43,202 +43,141 @@
different if and only if they do not compare equal (<c>==</c>).</p>
</description>
- <section>
- <title>DATA TYPES</title>
- <code type="none">
-set()
- as returned by new/0</code>
- </section>
+ <datatypes>
+ <datatype>
+ <name><marker id="type-dict">set()</marker></name>
+ <desc><p>As returned by <c>new/0</c>.</p></desc>
+ </datatype>
+ </datatypes>
<funcs>
<func>
- <name>new() -> Set</name>
+ <name name="new" arity="0"/>
<fsummary>Return an empty set</fsummary>
- <type>
- <v>Set = set()</v>
- </type>
<desc>
<p>Returns a new empty set.</p>
</desc>
</func>
<func>
- <name>is_set(Set) -> bool()</name>
+ <name name="is_set" arity="1"/>
<fsummary>Test for an <c>Set</c></fsummary>
- <type>
- <v>Set = term()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Set</c> is a set of
+ <p>Returns <c>true</c> if <c><anno>Set</anno></c> is a set of
elements, otherwise <c>false</c>.</p>
</desc>
</func>
<func>
- <name>size(Set) -> int()</name>
+ <name name="size" arity="1"/>
<fsummary>Return the number of elements in a set</fsummary>
- <type>
- <v>Set = term()</v>
- </type>
<desc>
- <p>Returns the number of elements in <c>Set</c>.</p>
+ <p>Returns the number of elements in <c><anno>Set</anno></c>.</p>
</desc>
</func>
<func>
- <name>to_list(Set) -> List</name>
+ <name name="to_list" arity="1"/>
<fsummary>Convert an <c>Set</c>into a list</fsummary>
- <type>
- <v>Set = set()</v>
- <v>List = [term()]</v>
- </type>
<desc>
- <p>Returns the elements of <c>Set</c> as a list.</p>
+ <p>Returns the elements of <c><anno>Set</anno></c> as a list.</p>
</desc>
</func>
<func>
- <name>from_list(List) -> Set</name>
+ <name name="from_list" arity="1"/>
<fsummary>Convert a list into an <c>Set</c></fsummary>
- <type>
- <v>List = [term()]</v>
- <v>Set = set()</v>
- </type>
<desc>
- <p>Returns an set of the elements in <c>List</c>.</p>
+ <p>Returns an set of the elements in <c><anno>List</anno></c>.</p>
</desc>
</func>
<func>
- <name>is_element(Element, Set) -> bool()</name>
+ <name name="is_element" arity="2"/>
<fsummary>Test for membership of an <c>Set</c></fsummary>
- <type>
- <v>Element = term()</v>
- <v>Set = set()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Element</c> is an element of
- <c>Set</c>, otherwise <c>false</c>.</p>
+ <p>Returns <c>true</c> if <c><anno>Element</anno></c> is an element of
+ <c><anno>Set</anno></c>, otherwise <c>false</c>.</p>
</desc>
</func>
<func>
- <name>add_element(Element, Set1) -> Set2</name>
+ <name name="add_element" arity="2"/>
<fsummary>Add an element to an <c>Set</c></fsummary>
- <type>
- <v>Element = term()</v>
- <v>Set1 = Set2 = set()</v>
- </type>
<desc>
- <p>Returns a new set formed from <c>Set1</c> with
- <c>Element</c> inserted.</p>
+ <p>Returns a new set formed from <c><anno>Set1</anno></c> with
+ <c><anno>Element</anno></c> inserted.</p>
</desc>
</func>
<func>
- <name>del_element(Element, Set1) -> Set2</name>
+ <name name="del_element" arity="2"/>
<fsummary>Remove an element from an <c>Set</c></fsummary>
- <type>
- <v>Element = term()</v>
- <v>Set1 = Set2 = set()</v>
- </type>
<desc>
- <p>Returns <c>Set1</c>, but with <c>Element</c> removed.</p>
+ <p>Returns <c><anno>Set1</anno></c>, but with <c><anno>Element</anno></c> removed.</p>
</desc>
</func>
<func>
- <name>union(Set1, Set2) -> Set3</name>
+ <name name="union" arity="2"/>
<fsummary>Return the union of two <c>Sets</c></fsummary>
- <type>
- <v>Set1 = Set2 = Set3 = set()</v>
- </type>
<desc>
- <p>Returns the merged (union) set of <c>Set1</c> and
- <c>Set2</c>.</p>
+ <p>Returns the merged (union) set of <c><anno>Set1</anno></c> and
+ <c><anno>Set2</anno></c>.</p>
</desc>
</func>
<func>
- <name>union(SetList) -> Set</name>
+ <name name="union" arity="1"/>
<fsummary>Return the union of a list of <c>Sets</c></fsummary>
- <type>
- <v>SetList = [set()]</v>
- <v>Set = set()</v>
- </type>
<desc>
<p>Returns the merged (union) set of the list of sets.</p>
</desc>
</func>
<func>
- <name>intersection(Set1, Set2) -> Set3</name>
+ <name name="intersection" arity="2"/>
<fsummary>Return the intersection of two <c>Sets</c></fsummary>
- <type>
- <v>Set1 = Set2 = Set3 = set()</v>
- </type>
<desc>
- <p>Returns the intersection of <c>Set1</c> and
- <c>Set2</c>.</p>
+ <p>Returns the intersection of <c><anno>Set1</anno></c> and
+ <c><anno>Set2</anno></c>.</p>
</desc>
</func>
<func>
- <name>intersection(SetList) -> Set</name>
+ <name name="intersection" arity="1"/>
<fsummary>Return the intersection of a list of <c>Sets</c></fsummary>
- <type>
- <v>SetList = [set()]</v>
- <v>Set = set()</v>
- </type>
<desc>
<p>Returns the intersection of the non-empty list of sets.</p>
</desc>
</func>
<func>
- <name>is_disjoint(Set1, Set2) -> bool()</name>
+ <name name="is_disjoint" arity="2"/>
<fsummary>Check whether two <c>Sets</c> are disjoint</fsummary>
- <type>
- <v>Set1 = Set2 = set()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Set1</c> and
- <c>Set2</c> are disjoint (have no elements in common),
+ <p>Returns <c>true</c> if <c><anno>Set1</anno></c> and
+ <c><anno>Set2</anno></c> are disjoint (have no elements in common),
and <c>false</c> otherwise.</p>
</desc>
</func>
<func>
- <name>subtract(Set1, Set2) -> Set3</name>
+ <name name="subtract" arity="2"/>
<fsummary>Return the difference of two <c>Sets</c></fsummary>
- <type>
- <v>Set1 = Set2 = Set3 = set()</v>
- </type>
<desc>
- <p>Returns only the elements of <c>Set1</c> which are not
- also elements of <c>Set2</c>.</p>
+ <p>Returns only the elements of <c><anno>Set1</anno></c> which are not
+ also elements of <c><anno>Set2</anno></c>.</p>
</desc>
</func>
<func>
- <name>is_subset(Set1, Set2) -> bool()</name>
+ <name name="is_subset" arity="2"/>
<fsummary>Test for subset</fsummary>
- <type>
- <v>Set1 = Set2 = set()</v>
- </type>
<desc>
- <p>Returns <c>true</c> when every element of <c>Set</c>1 is
- also a member of <c>Set2</c>, otherwise <c>false</c>.</p>
+ <p>Returns <c>true</c> when every element of <c><anno>Set1</anno></c>1 is
+ also a member of <c><anno>Set2</anno></c>, otherwise <c>false</c>.</p>
</desc>
</func>
<func>
- <name>fold(Function, Acc0, Set) -> Acc1</name>
+ <name name="fold" arity="3"/>
<fsummary>Fold over set elements</fsummary>
- <type>
- <v>Function = fun (E, AccIn) -> AccOut</v>
- <v>Acc0 = Acc1 = AccIn = AccOut = term()</v>
- <v>Set = set()</v>
- </type>
<desc>
- <p>Fold <c>Function</c> over every element in <c>Set</c>
+ <p>Fold <c><anno>Function</anno></c> over every element in <c><anno>Set</anno></c>
returning the final value of the accumulator.</p>
</desc>
</func>
<func>
- <name>filter(Pred, Set1) -> Set2</name>
+ <name name="filter" arity="2"/>
<fsummary>Filter set elements</fsummary>
- <type>
- <v>Pred = fun (E) -> bool()</v>
- <v>Set1 = Set2 = set()</v>
- </type>
<desc>
- <p>Filter elements in <c>Set1</c> with boolean function
- <c>Fun</c>.</p>
+ <p>Filter elements in <c><anno>Set1</anno></c> with boolean function
+ <c><anno>Pred</anno></c>.</p>
</desc>
</func>
</funcs>