Skip to content
Draft
Show file tree
Hide file tree
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
10 changes: 9 additions & 1 deletion src/FSharp.Core/array.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ module Array =
///
/// <exception cref="T:System.ArgumentNullException">Thrown when either of the input arrays is null.</exception>
///
/// <remarks>Time complexity: O(n + m) where n and m are the lengths of the input arrays. Space complexity: O(n + m).</remarks>
///
/// <example id="append-1">
/// <code lang="fsharp">
/// Array.append [| 1; 2 |] [| 3; 4 |]
Expand Down Expand Up @@ -278,6 +280,8 @@ module Array =
///
/// <exception cref="T:System.ArgumentNullException">Thrown when the input sequence is null.</exception>
///
/// <remarks>Time complexity: O(n) where n is the total number of elements in all arrays. Space complexity: O(n).</remarks>
///
/// <example id="concat-1">
/// <code lang="fsharp">
/// let inputs = [ [| 1; 2 |]; [| 3 |]; [| 4; 5 |] ]
Expand Down Expand Up @@ -1234,6 +1238,8 @@ module Array =
/// <exception cref="T:System.ArgumentNullException">Thrown when the input array is null.</exception>
/// <exception cref="T:System.ArgumentException">Thrown when the input array is empty.</exception>
///
/// <remarks>Time complexity: O(1). Space complexity: O(1).</remarks>
///
/// <example id="head-1">
/// <code lang="fsharp">
/// let inputs = [| "banana"; "pear" |]
Expand Down Expand Up @@ -1530,7 +1536,7 @@ module Array =
///
/// <returns>The length of the array.</returns>
///
/// <remarks>The notation <c>array.Length</c> is preferred.</remarks>
/// <remarks>Time complexity: O(1). Space complexity: O(1). The notation <c>array.Length</c> is preferred.</remarks>
///
/// <exception cref="T:System.NullReferenceException">Thrown when the input array is null.</exception>
///
Expand Down Expand Up @@ -2582,6 +2588,8 @@ module Array =
///
/// <returns>A new array containing the elements of the original except the first element.</returns>
///
/// <remarks>Time complexity: O(n) where n is the length of the array. Space complexity: O(n).</remarks>
///
/// <example id="tail-1">
/// <code lang="fsharp">
/// let inputs = [| "a"; "bb"; "ccc" |]
Expand Down
10 changes: 9 additions & 1 deletion src/FSharp.Core/list.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ module List =
///
/// <returns>The resulting list.</returns>
///
/// <remarks>Time complexity: O(n) where n is the length of the first list. Space complexity: O(n).</remarks>
///
/// <example id="append-1">
/// <code lang="fsharp">
/// List.append [ 1..3 ] [ 4..7 ]
Expand Down Expand Up @@ -345,6 +347,8 @@ module List =
///
/// <returns>The resulting concatenated list.</returns>
///
/// <remarks>Time complexity: O(n) where n is the total number of elements in all lists. Space complexity: O(n).</remarks>
///
/// <example id="concat-1">
/// <code lang="fsharp">
/// let input = [ [1;2]
Expand Down Expand Up @@ -1013,6 +1017,8 @@ module List =
///
/// <returns>The first element of the list.</returns>
///
/// <remarks>Time complexity: O(1). Space complexity: O(1).</remarks>
///
/// <example id="head-1">
/// <code lang="fsharp">
/// let inputs = ["banana"; "pear"]
Expand Down Expand Up @@ -1251,7 +1257,7 @@ module List =
///
/// <returns>The length of the list.</returns>
///
/// <remarks>The notation <c>array.Length</c> is preferred.</remarks>
/// <remarks>Time complexity: O(n) where n is the length of the list. Space complexity: O(1). The notation <c>array.Length</c> is preferred.</remarks>
///
/// <example id="length-1">
/// <code lang="fsharp">
Expand Down Expand Up @@ -2088,6 +2094,8 @@ module List =
///
/// <returns>The list after removing the first element.</returns>
///
/// <remarks>Time complexity: O(1). Space complexity: O(1).</remarks>
///
/// <example id="tail-1">
/// <code lang="fsharp">
/// let inputs = ["a"; "bb"; "ccc"]
Expand Down
4 changes: 4 additions & 0 deletions src/FSharp.Core/map.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ module Map =
///
/// <returns>The resulting map.</returns>
///
/// <remarks>Time complexity: O(log n) where n is the size of the map. Space complexity: O(log n) due to path copying in the balanced tree.</remarks>
///
/// <example id="add-1">
/// <code lang="fsharp">
/// let input = Map [ (1, "a"); (2, "b") ]
Expand Down Expand Up @@ -643,6 +645,8 @@ module Map =
///
/// <returns>The resulting map.</returns>
///
/// <remarks>Time complexity: O(log n) where n is the size of the map. Space complexity: O(log n) due to path copying in the balanced tree.</remarks>
///
/// <example id="remove-1">
/// <code lang="fsharp">
/// let sample = Map [ (1, "a"); (2, "b") ]
Expand Down
4 changes: 4 additions & 0 deletions src/FSharp.Core/prim-types.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -2674,6 +2674,8 @@ namespace Microsoft.FSharp.Collections
[<CompiledName("FSharpList`1")>]
type List<'T> =
| ([]): 'T list
/// <summary>Cons operator for adding an element to the front of a list.</summary>
/// <remarks>Time complexity: O(1). Space complexity: O(1).</remarks>
| (::): Head: 'T * Tail: 'T list -> 'T list

/// <summary>Returns an empty list of a particular type</summary>
Expand Down Expand Up @@ -3800,6 +3802,8 @@ namespace Microsoft.FSharp.Core
///
/// <returns>The concatenation of the lists.</returns>
///
/// <remarks>Time complexity: O(n) where n is the length of the first list. Space complexity: O(n).</remarks>
///
/// <example id="list-concat-example">
/// <code lang="fsharp">
/// let l1 = ['a'; 'b'; 'c']
Expand Down
4 changes: 3 additions & 1 deletion src/FSharp.Core/seq.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ module Seq =
///
/// <remarks>The returned sequence may be passed between threads safely. However,
/// individual IEnumerator values generated from the returned sequence should not be accessed
/// concurrently.</remarks>
/// concurrently.
///
/// Time complexity: O(1) - sequences are lazily evaluated. Space complexity: O(1).</remarks>
///
/// <param name="source1">The first sequence.</param>
/// <param name="source2">The second sequence.</param>
Expand Down
8 changes: 8 additions & 0 deletions src/FSharp.Core/set.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ module Set =
///
/// <returns>A new set containing <c>value</c>.</returns>
///
/// <remarks>Time complexity: O(log n) where n is the size of the set. Space complexity: O(log n) due to path copying in the balanced tree.</remarks>
///
/// <example id="set-add">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(1).Add(2)
Expand Down Expand Up @@ -539,6 +541,8 @@ module Set =
///
/// <returns>The intersection of <c>set1</c> and <c>set2</c>.</returns>
///
/// <remarks>Time complexity: O(n + m) where n and m are the sizes of the input sets. Space complexity: O(min(n, m)).</remarks>
///
/// <example id="set-intersect">
/// <code lang="fsharp">
/// let set1 = Set.empty.Add(1).Add(2).Add(3)
Expand Down Expand Up @@ -582,6 +586,8 @@ module Set =
///
/// <returns>The union of <c>set1</c> and <c>set2</c>.</returns>
///
/// <remarks>Time complexity: O(n + m) where n and m are the sizes of the input sets. Space complexity: O(n + m).</remarks>
///
/// <example id="set-union">
/// <code lang="fsharp">
/// let set1 = Set.empty.Add(1).Add(2).Add(3)
Expand Down Expand Up @@ -680,6 +686,8 @@ module Set =
///
/// <returns>The input set with <c>value</c> removed.</returns>
///
/// <remarks>Time complexity: O(log n) where n is the size of the set. Space complexity: O(log n) due to path copying in the balanced tree.</remarks>
///
/// <example id="set-remove">
/// <code lang="fsharp">
/// let set = Set.empty.Add(1).Add(2).Add(3)
Expand Down
Loading