Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions src/FSharp.Core/set.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ type Set<[<EqualityConditionalOn>] 'T when 'T: comparison> =
///
/// <returns>The result set.</returns>
///
/// <remarks>Time complexity: O(n log n). Space complexity: O(n).</remarks>
///
/// <example id="set-new">
/// <code lang="fsharp">
/// let sequenceOfNumbers = seq { 1 .. 3 }
Expand All @@ -43,6 +45,8 @@ type Set<[<EqualityConditionalOn>] 'T when 'T: comparison> =
///
/// <returns>The result set.</returns>
///
/// <remarks>Time complexity: O(log n). Space complexity: O(log n).</remarks>
///
/// <example>
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(1).Add(2)
Expand All @@ -60,6 +64,8 @@ type Set<[<EqualityConditionalOn>] 'T when 'T: comparison> =
///
/// <returns>The result set.</returns>
///
/// <remarks>Time complexity: O(log n). Space complexity: O(log n).</remarks>
///
/// <example id="set-remove">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(1).Add(2)
Expand All @@ -71,6 +77,8 @@ type Set<[<EqualityConditionalOn>] 'T when 'T: comparison> =

/// <summary>The number of elements in the set</summary>
///
/// <remarks>Time complexity: O(n). Space complexity: O(log n).</remarks>
///
/// <example id="set-count">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(1).Add(2)
Expand All @@ -86,6 +94,8 @@ type Set<[<EqualityConditionalOn>] 'T when 'T: comparison> =
///
/// <returns>True if the set contains <c>value</c>.</returns>
///
/// <remarks>Time complexity: O(log n). Space complexity: O(log n).</remarks>
///
/// <example id="set-contains">
/// <code lang="fsharp">
/// let set = Set.empty.Add(2).Add(3)
Expand All @@ -97,6 +107,8 @@ type Set<[<EqualityConditionalOn>] 'T when 'T: comparison> =

/// <summary>A useful shortcut for Set.isEmpty. See the Set module for further operations on sets.</summary>
///
/// <remarks>Time complexity: O(1). Space complexity: O(1).</remarks>
///
/// <example id="set-isempty">
/// <code lang="fsharp">
/// let set = Set.empty.Add(2).Add(3)
Expand Down Expand Up @@ -264,6 +276,8 @@ module Set =

/// <summary>The empty set for the type 'T.</summary>
///
/// <remarks>Time complexity: O(1). Space complexity: O(1).</remarks>
///
/// <example id="empty-1">
/// <code lang="fsharp">
/// Set.empty&lt;int&gt;
Expand All @@ -280,6 +294,8 @@ module Set =
///
/// <returns>The set containing <c>value</c>.</returns>
///
/// <remarks>Time complexity: O(1). Space complexity: O(1).</remarks>
///
/// <example id="singleton-1">
/// <code lang="fsharp">
/// Set.singleton 7
Expand All @@ -297,6 +313,8 @@ module Set =
///
/// <returns>A new set containing <c>value</c>.</returns>
///
/// <remarks>Time complexity: O(log n). Space complexity: O(log n).</remarks>
///
/// <example id="set-add">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(1).Add(2)
Expand All @@ -314,6 +332,8 @@ module Set =
///
/// <returns>True if <c>element</c> is in <c>set</c>.</returns>
///
/// <remarks>Time complexity: O(log n). Space complexity: O(log n).</remarks>
///
/// <example id="set-contains">
/// <code lang="fsharp">
/// let set = Set.empty.Add(2).Add(3)
Expand All @@ -331,6 +351,8 @@ module Set =
///
/// <returns>True if <c>set1</c> is a subset of <c>set2</c>.</returns>
///
/// <remarks>Time complexity: O(m log n) where m and n are the sizes of <c>set1</c> and <c>set2</c> respectively. Space complexity: O(log n).</remarks>
///
/// <example id="set-issubset">
/// <code lang="fsharp">
/// let set1 = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -350,6 +372,8 @@ module Set =
///
/// <returns>True if <c>set1</c> is a proper subset of <c>set2</c>.</returns>
///
/// <remarks>Time complexity: O(m log n) where m and n are the sizes of <c>set1</c> and <c>set2</c> respectively. Space complexity: O(log n).</remarks>
///
/// <example id="set-ispropersubset">
/// <code lang="fsharp">
/// let set1 = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -368,6 +392,8 @@ module Set =
///
/// <returns>True if <c>set1</c> is a superset of <c>set2</c>.</returns>
///
/// <remarks>Time complexity: O(m log n) where m and n are the sizes of <c>set2</c> and <c>set1</c> respectively. Space complexity: O(log n).</remarks>
///
/// <example id="set-issuperset">
/// <code lang="fsharp">
/// let set1 = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -387,6 +413,8 @@ module Set =
///
/// <returns>True if <c>set1</c> is a proper superset of <c>set2</c>.</returns>
///
/// <remarks>Time complexity: O(m log n) where m and n are the sizes of <c>set2</c> and <c>set1</c> respectively. Space complexity: O(log n).</remarks>
///
/// <example id="set-ispropersuperset">
/// <code lang="fsharp">
/// let set1 = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -404,6 +432,8 @@ module Set =
///
/// <returns>The number of elements in the set.</returns>
///
/// <remarks>Time complexity: O(n). Space complexity: O(log n).</remarks>
///
/// <example id="set-count">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -423,6 +453,8 @@ module Set =
///
/// <returns>True if any element of <c>set</c> satisfies <c>predicate</c>.</returns>
///
/// <remarks>Time complexity: O(n) worst case. Space complexity: O(log n).</remarks>
///
/// <example id="set-exists">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -441,6 +473,8 @@ module Set =
///
/// <returns>The set containing only the elements for which <c>predicate</c> returns true.</returns>
///
/// <remarks>Time complexity: O(n log n). Space complexity: O(n).</remarks>
///
/// <example id="set-filter">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(2).Add(3).Add(4)
Expand All @@ -459,6 +493,8 @@ module Set =
///
/// <returns>A set containing the transformed elements.</returns>
///
/// <remarks>Time complexity: O(n log n). Space complexity: O(n).</remarks>
///
/// <example id="set-map">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -477,6 +513,8 @@ module Set =
///
/// <returns>The final state.</returns>
///
/// <remarks>Time complexity: O(n). Space complexity: O(log n).</remarks>
///
/// <example id="set-fold">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -500,6 +538,8 @@ module Set =
///
/// <returns>The final state.</returns>
///
/// <remarks>Time complexity: O(n). Space complexity: O(log n).</remarks>
///
/// <example id="set-foldback">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -522,6 +562,8 @@ module Set =
///
/// <returns>True if all elements of <c>set</c> satisfy <c>predicate</c>.</returns>
///
/// <remarks>Time complexity: O(n) worst case. Space complexity: O(log n).</remarks>
///
/// <example id="set-forall">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -539,6 +581,8 @@ module Set =
///
/// <returns>The intersection of <c>set1</c> and <c>set2</c>.</returns>
///
/// <remarks>Time complexity: O(m log n) where m and n are the sizes of <c>set1</c> and <c>set2</c> respectively. Space complexity: O(min(m, n)).</remarks>
///
/// <example id="set-intersect">
/// <code lang="fsharp">
/// let set1 = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -556,6 +600,8 @@ module Set =
///
/// <returns>The intersection of the input sets.</returns>
///
/// <remarks>Time complexity: O(k * m log n) where k is the number of sets, m is the average size of sets, and n is the size of the largest set. Space complexity: O(n).</remarks>
///
/// <example id="set-intersectmany">
/// <code lang="fsharp">
/// let headersByFile = seq{
Expand All @@ -582,6 +628,8 @@ module Set =
///
/// <returns>The union of <c>set1</c> and <c>set2</c>.</returns>
///
/// <remarks>Time complexity: O(m log n) where m and n are the sizes of <c>set1</c> and <c>set2</c> respectively. Space complexity: O(m + n).</remarks>
///
/// <example id="set-union">
/// <code lang="fsharp">
/// let set1 = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -599,6 +647,8 @@ module Set =
///
/// <returns>The union of the input sets.</returns>
///
/// <remarks>Time complexity: O(k * m log n) where k is the number of sets, m is the average size of sets, and n is the size of the result set. Space complexity: O(total elements).</remarks>
///
/// <example id="set-unionmany">
/// <code lang="fsharp">
/// let headersByFile = seq{
Expand All @@ -624,6 +674,8 @@ module Set =
///
/// <returns>True if <c>set</c> is empty.</returns>
///
/// <remarks>Time complexity: O(1). Space complexity: O(1).</remarks>
///
/// <example id="set-isempty">
/// <code lang="fsharp">
/// let set = Set.empty.Add(2).Add(3)
Expand All @@ -640,6 +692,8 @@ module Set =
/// <param name="action">The function to apply to each element.</param>
/// <param name="set">The input set.</param>
///
/// <remarks>Time complexity: O(n). Space complexity: O(log n).</remarks>
///
/// <example id="set-iter">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -662,6 +716,8 @@ module Set =
/// <returns>A pair of sets with the first containing the elements for which <c>predicate</c> returns
/// true and the second containing the elements for which <c>predicate</c> returns false.</returns>
///
/// <remarks>Time complexity: O(n log n). Space complexity: O(n).</remarks>
///
/// <example id="set-partition">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(2).Add(3).Add(4)
Expand All @@ -680,6 +736,8 @@ module Set =
///
/// <returns>The input set with <c>value</c> removed.</returns>
///
/// <remarks>Time complexity: O(log n). Space complexity: O(log n).</remarks>
///
/// <example id="set-remove">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -696,6 +754,8 @@ module Set =
///
/// <returns>The min value from the set.</returns>
///
/// <remarks>Time complexity: O(log n). Space complexity: O(log n).</remarks>
///
/// <example id="set-minelement">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -712,6 +772,8 @@ module Set =
///
/// <returns>The max value from the set.</returns>
///
/// <remarks>Time complexity: O(log n). Space complexity: O(log n).</remarks>
///
/// <example id="set-maxelement">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -728,6 +790,8 @@ module Set =
///
/// <returns>A set containing the elements form the input list.</returns>
///
/// <remarks>Time complexity: O(n log n). Space complexity: O(n).</remarks>
///
/// <example id="set-oflist">
/// <code lang="fsharp">
/// let set = Set.ofList [1, 2, 3]
Expand All @@ -744,6 +808,8 @@ module Set =
///
/// <returns>An ordered list of the elements of <c>set</c>.</returns>
///
/// <remarks>Time complexity: O(n). Space complexity: O(n).</remarks>
///
/// <example id="set-tolist">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -761,6 +827,8 @@ module Set =
///
/// <returns>A set containing the elements of <c>array</c>.</returns>
///
/// <remarks>Time complexity: O(n log n). Space complexity: O(n).</remarks>
///
/// <example id="set-remove">
/// <code lang="fsharp">
/// let set = Set.ofArray [|1, 2, 3|]
Expand All @@ -777,6 +845,8 @@ module Set =
///
/// <returns>An ordered array of the elements of <c>set</c>.</returns>
///
/// <remarks>Time complexity: O(n). Space complexity: O(n).</remarks>
///
/// <example id="set-toarray">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -794,6 +864,8 @@ module Set =
///
/// <returns>An ordered sequence of the elements of <c>set</c>.</returns>
///
/// <remarks>Time complexity: O(1) for sequence creation, O(n) for full enumeration. Space complexity: O(log n) during enumeration.</remarks>
///
/// <example id="set-toseq">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(2).Add(3)
Expand All @@ -811,6 +883,8 @@ module Set =
///
/// <returns>The set containing <c>elements</c>.</returns>
///
/// <remarks>Time complexity: O(n log n). Space complexity: O(n).</remarks>
///
/// <example id="set-ofseq">
/// <code lang="fsharp">
/// let set = Set.ofSeq [1, 2, 3]
Expand All @@ -828,6 +902,8 @@ module Set =
///
/// <returns>The set with the elements of <c>set2</c> removed from <c>set1</c>.</returns>
///
/// <remarks>Time complexity: O(m log n) where m and n are the sizes of <c>set2</c> and <c>set1</c> respectively. Space complexity: O(n).</remarks>
///
/// <example id="set-difference">
/// <code lang="fsharp">
/// let set1 = Set.empty.Add(1).Add(2).Add(3)
Expand Down
Loading