Skip to content

Commit b152848

Browse files
dsymebaronfel
authored andcommitted
Feature/docs improvements (#9854)
* improve xml doc spacing * improve cref nodes * fix broken xml doc * fix more crefs * doc improvements * improve docs for FSHarp.Core
1 parent e8bc3e5 commit b152848

File tree

9 files changed

+141
-103
lines changed

9 files changed

+141
-103
lines changed

src/fsharp/FSharp.Core/array.fsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ namespace Microsoft.FSharp.Collections
88
open System.Collections.Generic
99

1010
/// <summary>Basic operations on arrays.</summary>
11+
///
12+
/// <remarks>
13+
/// See also <a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/arrays">F# Language Guide - Arrays</a>.
14+
/// </remarks>
1115
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
1216
[<RequireQualifiedAccess>]
1317
module Array =

src/fsharp/FSharp.Core/array2.fsi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,19 @@ namespace Microsoft.FSharp.Collections
1010
[<RequireQualifiedAccess>]
1111
/// <summary>Basic operations on 2-dimensional arrays.</summary>
1212
///
13-
/// <remarks>F# and CLI multi-dimensional arrays are typically zero-based.
13+
/// <remarks>
14+
/// <para>See also <a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/arrays">F# Language Guide - Arrays</a>.</para>
15+
///
16+
/// <para>F# and CLI multi-dimensional arrays are typically zero-based.
1417
/// However, CLI multi-dimensional arrays used in conjunction with external
1518
/// libraries (e.g. libraries associated with Visual Basic) be
1619
/// non-zero based, using a potentially different base for each dimension.
1720
/// The operations in this module will accept such arrays, and
1821
/// the basing on an input array will be propagated to a matching output
1922
/// array on the <c>Array2D.map</c> and <c>Array2D.mapi</c> operations.
2023
/// Non-zero-based arrays can also be created using <c>Array2D.zeroCreateBased</c>,
21-
/// <c>Array2D.createBased</c> and <c>Array2D.initBased</c>.</remarks>
24+
/// <c>Array2D.createBased</c> and <c>Array2D.initBased</c>.</para>
25+
/// </remarks>
2226
module Array2D =
2327

2428
/// <summary>Fetches the base-index for the first dimension of the array.</summary>

src/fsharp/FSharp.Core/array3.fsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ namespace Microsoft.FSharp.Collections
1010
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
1111
[<RequireQualifiedAccess>]
1212
/// <summary>Basic operations on rank 3 arrays.</summary>
13+
///
14+
/// <remarks>
15+
/// See also <a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/arrays">F# Language Guide - Arrays</a>.
16+
/// </remarks>
1317
module Array3D =
1418

1519
/// <summary>Creates an array whose elements are all initially the given value.</summary>

src/fsharp/FSharp.Core/async.fsi

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,25 @@ namespace Microsoft.FSharp.Control
1111
open Microsoft.FSharp.Control
1212
open Microsoft.FSharp.Collections
1313

14-
/// <summary>A compositional asynchronous computation, which, when run, will eventually produce a value
15-
/// of type T, or else raises an exception.</summary>
14+
/// <summary>
15+
/// An asynchronous computation, which, when run, will eventually produce a value of type T, or else raises an exception.
16+
/// </summary>
1617
///
17-
/// <remarks>Asynchronous computations are normally specified using an F# computation expression.
18+
/// <remarks>
19+
/// This type has no members. Asynchronous computations are normally specified either by using an async expression
20+
/// or the static methods in the <see cref="T:Microsoft.FSharp.Control.Async"/> type.
1821
///
19-
/// When run, asynchronous computations have two modes: as a work item (executing synchronous
20-
/// code), or as a wait item (waiting for an event or I/O completion).
21-
///
22-
/// When run, asynchronous computations can be governed by CancellationToken. This can usually
23-
/// be specified when the async computation is started. The associated CancellationTokenSource
24-
/// may be used to cancel the asynchronous computation. Asynchronous computations built using
25-
/// computation expressions can check the cancellation condition regularly. Synchronous
26-
/// computations within an asynchronous computation do not automatically check this condition.</remarks>
22+
/// See also <a href="https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/asynchronous-workflows">F# Language Guide - Async Workflows</a>.
23+
/// </remarks>
2724
2825
[<Sealed; NoEquality; NoComparison; CompiledName("FSharpAsync`1")>]
2926
type Async<'T>
3027

31-
/// <summary>This static class holds members for creating and manipulating asynchronous computations.</summary>
28+
/// <summary>Holds static members for creating and manipulating asynchronous computations.</summary>
29+
///
30+
/// <remarks>
31+
/// See also <a href="https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/asynchronous-workflows">F# Language Guide - Async Workflows</a>.
32+
/// </remarks>
3233
3334
[<Sealed>]
3435
[<CompiledName("FSharpAsync")>]
@@ -47,7 +48,7 @@ namespace Microsoft.FSharp.Control
4748
/// <param name="computation">The computation to run.</param>
4849
/// <param name="timeout">The amount of time in milliseconds to wait for the result of the
4950
/// computation before raising a <see cref="T:System.TimeoutException"/>. If no value is provided
50-
/// for timeout then a default of -1 is used to correspond to System.Threading.Timeout.Infinite.
51+
/// for timeout then a default of -1 is used to correspond to <see cref="F:System.Threading.Timeout.Infinite"/>.
5152
/// If a cancellable cancellationToken is provided, timeout parameter will be ignored</param>
5253
/// <param name="cancellationToken">The cancellation token to be associated with the computation.
5354
/// If one is not supplied, the default cancellation token is used.</param>

src/fsharp/FSharp.Core/collections.fsi

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,63 @@ namespace Microsoft.FSharp.Collections
99
open System
1010
open System.Collections.Generic
1111

12-
/// <summary>Common notions of comparison identity used with sorted data structures.</summary>
12+
/// <summary>Common notions of value ordering implementing the <see cref="T:System.Collections.Generic.IComparer`1"/>
13+
/// interface, for constructing sorted data structures and performing sorting operations.</summary>
1314
module ComparisonIdentity =
1415

15-
/// <summary>Structural comparison. Compare using Operators.compare.</summary>
16+
/// <summary>Get an implementation of comparison semantics using structural comparison.</summary>
17+
///
18+
/// <returns>An object implementing <see cref="T:System.Collections.Generic.IComparer`1"/> using <see cref="M:Microsoft.FSharp.Core.Operators.compare"/>.</returns>
1619
val inline Structural<'T> : IComparer<'T> when 'T : comparison
1720

18-
/// <summary>Non-structural comparison. Compare using NonStructuralComparison.compare.</summary>
21+
/// <summary>Get an implementation of comparison semantics using non-structural comparison.</summary>
22+
///
23+
/// <returns>An object implementing <see cref="T:System.Collections.Generic.IComparer`1"/> using <see cref="M:Microsoft.FSharp.Core.Operators.NonStructuralComparison.compare"/>.</returns>
1924
val inline NonStructural< ^T > : IComparer< ^T > when ^T : (static member ( < ) : ^T * ^T -> bool) and ^T : (static member ( > ) : ^T * ^T -> bool)
2025

21-
/// <summary>Compare using the given comparer function.</summary>
26+
/// <summary>Get an implementation of comparison semantics using the given function.</summary>
27+
///
2228
/// <param name="comparer">A function to compare two values.</param>
2329
///
24-
/// <returns>An object implementing IComparer using the supplied comparer.</returns>
30+
/// <returns>An object implementing <see cref="T:System.Collections.Generic.IComparer`1"/> using the supplied function.</returns>
2531
val FromFunction : comparer:('T -> 'T -> int) -> IComparer<'T>
2632

27-
/// <summary>Common notions of value identity used with hash tables.</summary>
33+
/// <summary>Common notions of value identity implementing the <see cref="T:System.Collections.Generic.IEqualityComparer`1"/>
34+
/// interface, for constructing <see cref="T:System.Collections.Generic.Dictionary`2"/> objects and other collections</summary>
2835
module HashIdentity =
2936

30-
/// <summary>Structural hashing. Hash using Operators.(=) and Operators.hash.</summary>
37+
/// <summary>Get an implementation of equality semantics using structural equality and structural hashing.</summary>
38+
///
39+
/// <returns>An object implementing <see cref="T:System.Collections.Generic.IEqualityComparer`1"/> using <see cref="M:Microsoft.FSharp.Core.Operators.op_Equality"/> and <see cref="M:Microsoft.FSharp.Core.Operators.hash"/>.</returns>
3140
val inline Structural<'T> : IEqualityComparer<'T> when 'T : equality
3241

33-
/// <summary>Non-structural hashing. Equality using NonStructuralComparison.(=) and NonStructuralComparison.hash.</summary>
42+
/// <summary>Get an implementation of equality semantics using non-structural equality and non-structural hashing.</summary>
43+
///
44+
/// <returns>
45+
/// An object implementing <see cref="T:System.Collections.Generic.IEqualityComparer`1"/> using <see cref="M:Microsoft.FSharp.Core.Operators.NonStructuralComparison.op_Equality"/>
46+
/// and <see cref="M:Microsoft.FSharp.Core.Operators.NonStructuralComparison.hash"/>.
47+
/// </returns>
3448
val inline NonStructural<'T> : IEqualityComparer< ^T > when ^T : equality and ^T : (static member ( = ) : ^T * ^T -> bool)
3549

50+
/// <summary>Get an implementation of equality semantics semantics using structural equality and structural hashing.</summary>
51+
///
52+
/// <returns>An object implementing <see cref="T:System.Collections.Generic.IEqualityComparer`1"/>.</returns>
3653
val inline LimitedStructural<'T> : limit: int -> IEqualityComparer<'T> when 'T : equality
3754

38-
/// <summary>Physical hashing (hash on reference identity of objects, and the contents of value types).
39-
/// Hash using LanguagePrimitives.PhysicalEquality and LanguagePrimitives.PhysicalHash,
40-
/// That is, for value types use GetHashCode and Object.Equals (if no other optimization available),
41-
/// and for reference types use System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode and
42-
/// reference equality.</summary>
55+
/// <summary>Get an implementation of equality semantics using reference equality and reference hashing.</summary>
56+
///
57+
/// <returns>
58+
/// An object implementing <see cref="T:System.Collections.Generic.IEqualityComparer`1"/> using <see cref="M:Microsoft.FSharp.Core.LanguagePrimitives.PhysicalEquality"/>
59+
/// and <see cref="M:Microsoft.FSharp.Core.LanguagePrimitives.PhysicalHash"/>.
60+
/// </returns>
4361
val Reference<'T> : IEqualityComparer<'T> when 'T : not struct
4462

45-
/// <summary>Hash using the given hashing and equality functions.</summary>
63+
/// <summary>Get an implementation of equality semantics using the given functions.</summary>
4664
///
4765
/// <param name="hasher">A function to generate a hash code from a value.</param>
4866
/// <param name="equality">A function to test equality of two values.</param>
4967
///
50-
/// <returns>An object implementing IEqualityComparer using the supplied functions.</returns>
51-
52-
// inline justification: allows inlining of hash functions
68+
/// <returns>An object implementing <see cref="T:System.Collections.Generic.IEqualityComparer`1"/> using the given functions.</returns>
5369
val inline FromFunctions<'T> : hasher:('T -> int) -> equality:('T -> 'T -> bool) -> IEqualityComparer<'T>
5470

5571

src/fsharp/FSharp.Core/map.fsi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ namespace Microsoft.FSharp.Collections
77
open Microsoft.FSharp.Core
88
open Microsoft.FSharp.Collections
99

10-
/// <summary>Immutable maps. Keys are ordered by F# generic comparison.</summary>
10+
/// <summary>Immutable maps based on binary trees, where keys are ordered by F# generic comparison. By default
11+
/// comparison is the F# structural comparison function or uses implementations of the IComparable interface on key values.</summary>
1112
///
12-
/// <remarks>Maps based on generic comparison are efficient for small keys. They are not a suitable choice if keys are recursive data structures
13-
/// or if keys require bespoke comparison semantics.
13+
/// <remarks>See the <see cref="T:Microsoft.FSharp.Collections.MapModule"/> module for further operations on maps.
1414
///
1515
/// All members of this class are thread-safe and may be used concurrently from multiple threads.</remarks>
1616
[<CompiledName("FSharpMap`2")>]
@@ -93,7 +93,7 @@ namespace Microsoft.FSharp.Collections
9393
interface IReadOnlyDictionary<'Key,'Value>
9494
override Equals : obj -> bool
9595

96-
/// <summary>Functional programming operators related to the <c>Map&lt;_,_&gt;</c> type.</summary>
96+
/// <summary>Basic operations on values of type <see cref="T:Microsoft.FSharp.Collections.Map`2"/>.</summary>
9797
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
9898
[<RequireQualifiedAccess>]
9999
/// <summary>Basic operations on values of type <see cref="T:Microsoft.FSharp.Collections.Map`2"/>.</summary>

src/fsharp/FSharp.Core/prim-types.fsi

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,17 +2256,28 @@ namespace Microsoft.FSharp.Collections
22562256
interface IReadOnlyCollection<'T>
22572257
interface IReadOnlyList<'T>
22582258

2259-
/// <summary>An abbreviation for the type of immutable singly-linked lists. </summary>
2259+
/// <summary>The type of immutable singly-linked lists. </summary>
22602260
///
2261-
/// <remarks>Use the constructors <c>[]</c> and <c>::</c> (infix) to create values of this type, or
2262-
/// the notation <c>[1;2;3]</c>. Use the values in the <c>List</c> module to manipulate
2263-
/// values of this type, or pattern match against the values directly.</remarks>
2261+
/// <remarks>See the <see cref="T:Microsoft.FSharp.Collections.ListModule"/> module for further operations related to lists.
2262+
///
2263+
/// Use the constructors <c>[]</c> and <c>::</c> (infix) to create values of this type, or
2264+
/// the notation <c>[1; 2; 3]</c>. Use the values in the <c>List</c> module to manipulate
2265+
/// values of this type, or pattern match against the values directly.
2266+
///
2267+
/// See also <a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/lists">F# Language Guide - Lists</a>.
2268+
/// </remarks>
22642269
and 'T list = List<'T>
22652270

22662271
/// <summary>An abbreviation for the CLI type <see cref="T:System.Collections.Generic.List`1"/></summary>
22672272
type ResizeArray<'T> = System.Collections.Generic.List<'T>
22682273

22692274
/// <summary>An abbreviation for the CLI type <see cref="T:System.Collections.Generic.IEnumerable`1"/></summary>
2275+
///
2276+
/// <remarks>
2277+
/// See the <see cref="T:Microsoft.FSharp.Collections.SeqModule"/> module for further operations related to sequences.
2278+
///
2279+
/// See also <a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/sequences">F# Language Guide - Sequences</a>.
2280+
///</remarks>
22702281
type seq<'T> = IEnumerable<'T>
22712282

22722283
namespace Microsoft.FSharp.Core

0 commit comments

Comments
 (0)