Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit 6eb435e

Browse files
dsymenosami
authored andcommitted
Improve docs for FSharp.Core (dotnet#9880)
* various doc improvements * don't use uppercase since in cref it is shown as text
1 parent 6c91b94 commit 6eb435e

27 files changed

+781
-166
lines changed

src/fsharp/FSharp.Core/Linq.fsi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ open Microsoft.FSharp.Core
88
open Microsoft.FSharp.Collections
99
open Microsoft.FSharp.Quotations
1010

11+
/// <summary>
12+
/// Contains functionality to convert F# quotations to LINQ expression trees.
13+
/// </summary>
14+
///
15+
/// <namespacedoc><summary>
16+
/// Library functionality associated with converting F# quotations to .NET LINQ expression trees.
17+
/// </summary></namespacedoc>
1118
module LeafExpressionConverter =
1219
/// When used in a quotation, this function indicates a specific conversion
1320
/// should be performed when converting the quotation to a LINQ expression.

src/fsharp/FSharp.Core/MutableTuple.fs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ open Microsoft.FSharp.Core
2222
// This terminology mistake also runs all the way through Query.fs.
2323
// ----------------------------------------------------------------------------
2424

25-
/// This type shouldn't be used directly from user code.
25+
/// <summary>This type shouldn't be used directly from user code.</summary>
26+
/// <exclude />
2627
type AnonymousObject<'T1> =
2728
val private item1 : 'T1
2829
member x.Item1 = x.item1
2930

3031
new (Item1) = { item1 = Item1 }
3132

32-
/// This type shouldn't be used directly from user code.
33+
/// <summary>This type shouldn't be used directly from user code.</summary>
34+
/// <exclude />
3335
type AnonymousObject<'T1, 'T2> =
3436
val private item1 : 'T1
3537
member x.Item1 = x.item1
@@ -39,7 +41,8 @@ type AnonymousObject<'T1, 'T2> =
3941

4042
new (Item1, Item2) = { item1 = Item1; item2 = Item2 }
4143

42-
/// This type shouldn't be used directly from user code.
44+
/// <summary>This type shouldn't be used directly from user code.</summary>
45+
/// <exclude />
4346
type AnonymousObject<'T1, 'T2, 'T3> =
4447
val private item1 : 'T1
4548
member x.Item1 = x.item1
@@ -53,7 +56,8 @@ type AnonymousObject<'T1, 'T2, 'T3> =
5356
new (Item1, Item2, Item3) = { item1 = Item1; item2 = Item2; item3 = Item3 }
5457

5558

56-
/// This type shouldn't be used directly from user code.
59+
/// <summary>This type shouldn't be used directly from user code.</summary>
60+
/// <exclude />
5761
type AnonymousObject<'T1, 'T2, 'T3, 'T4> =
5862
val private item1 : 'T1
5963
member x.Item1 = x.item1
@@ -71,7 +75,8 @@ type AnonymousObject<'T1, 'T2, 'T3, 'T4> =
7175

7276

7377

74-
/// This type shouldn't be used directly from user code.
78+
/// <summary>This type shouldn't be used directly from user code.</summary>
79+
/// <exclude />
7580
type AnonymousObject<'T1, 'T2, 'T3, 'T4, 'T5> =
7681
val private item1 : 'T1
7782
member x.Item1 = x.item1
@@ -91,7 +96,8 @@ type AnonymousObject<'T1, 'T2, 'T3, 'T4, 'T5> =
9196
new (Item1, Item2, Item3, Item4, Item5) = { item1 = Item1; item2 = Item2; item3 = Item3; item4 = Item4 ; item5 = Item5 }
9297

9398

94-
/// This type shouldn't be used directly from user code.
99+
/// <summary>This type shouldn't be used directly from user code.</summary>
100+
/// <exclude />
95101
type AnonymousObject<'T1, 'T2, 'T3, 'T4, 'T5, 'T6> =
96102
val private item1 : 'T1
97103
member x.Item1 = x.item1
@@ -114,7 +120,8 @@ type AnonymousObject<'T1, 'T2, 'T3, 'T4, 'T5, 'T6> =
114120
new (Item1, Item2, Item3, Item4, Item5, Item6) = { item1 = Item1; item2 = Item2; item3 = Item3; item4 = Item4 ; item5 = Item5 ; item6 = Item6 }
115121

116122

117-
/// This type shouldn't be used directly from user code.
123+
/// <summary>This type shouldn't be used directly from user code.</summary>
124+
/// <exclude />
118125
type AnonymousObject<'T1, 'T2, 'T3, 'T4, 'T5, 'T6, 'T7> =
119126
val private item1 : 'T1
120127
member x.Item1 = x.item1
@@ -139,7 +146,8 @@ type AnonymousObject<'T1, 'T2, 'T3, 'T4, 'T5, 'T6, 'T7> =
139146

140147
new (Item1, Item2, Item3, Item4, Item5, Item6, Item7) = { item1 = Item1; item2 = Item2; item3 = Item3; item4 = Item4 ; item5 = Item5 ; item6 = Item6 ; item7 = Item7 }
141148

142-
/// This type shouldn't be used directly from user code.
149+
/// <summary>This type shouldn't be used directly from user code.</summary>
150+
/// <exclude />
143151
type AnonymousObject<'T1, 'T2, 'T3, 'T4, 'T5, 'T6, 'T7, 'T8> =
144152
val private item1 : 'T1
145153
member x.Item1 = x.item1

src/fsharp/FSharp.Core/Query.fsi

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,28 @@ namespace Microsoft.FSharp.Linq
1111
open System.Collections.Generic
1212

1313
[<NoComparison; NoEquality; Sealed>]
14+
/// <summary>
1415
/// A partial input or result in an F# query. This type is used to support the F# query syntax.
16+
/// </summary>
17+
///
18+
/// <namespacedoc><summary>
19+
/// Library functionality for F# query syntax and interoperability with .NET LINQ Expressions. See
20+
/// also <a href="https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/query-expressions">F# Query Expressions</a> in the F# Language Guide.
21+
/// </summary></namespacedoc>
1522
type QuerySource<'T, 'Q> =
1623
/// <summary>
1724
/// A method used to support the F# query syntax.
1825
/// </summary>
1926
new : seq<'T> -> QuerySource<'T,'Q>
27+
2028
/// <summary>
2129
/// A property used to support the F# query syntax.
2230
/// </summary>
2331
member Source : seq<'T>
2432

2533
[<Class>]
26-
/// The type used to support the F# query syntax. Use 'query { ... }' to use the query syntax.
34+
/// The type used to support the F# query syntax. Use 'query { ... }' to use the query syntax. See
35+
/// also <a href="https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/query-expressions">F# Query Expressions</a> in the F# Language Guide.
2736
type QueryBuilder =
2837
/// <summary>Create an instance of this builder. Use 'query { ... }' to use the query syntax.</summary>
2938
new : unit -> QueryBuilder
@@ -350,6 +359,13 @@ namespace Microsoft.FSharp.Linq.QueryRunExtensions
350359

351360
open Microsoft.FSharp.Core
352361

362+
/// <summary>
363+
/// A module used to support the F# query syntax.
364+
/// </summary>
365+
///
366+
/// <namespacedoc><summary>
367+
/// Contains modules used to support the F# query syntax.
368+
/// </summary></namespacedoc>
353369
module LowPriority =
354370
type Microsoft.FSharp.Linq.QueryBuilder with
355371
/// <summary>
@@ -358,6 +374,9 @@ namespace Microsoft.FSharp.Linq.QueryRunExtensions
358374
[<CompiledName("RunQueryAsValue")>]
359375
member Run : Microsoft.FSharp.Quotations.Expr<'T> -> 'T
360376

377+
/// <summary>
378+
/// A module used to support the F# query syntax.
379+
/// </summary>
361380
module HighPriority =
362381
type Microsoft.FSharp.Linq.QueryBuilder with
363382
/// <summary>

src/fsharp/FSharp.Core/array.fsi

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

10-
/// <summary>Basic operations on arrays.</summary>
10+
/// <summary>Contains operations for working with arrays.</summary>
1111
///
1212
/// <remarks>
1313
/// See also <a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/arrays">F# Language Guide - Arrays</a>.
@@ -1033,10 +1033,10 @@ namespace Microsoft.FSharp.Collections
10331033
[<CompiledName("GetSubArray")>]
10341034
val sub: array:'T[] -> startIndex:int -> count:int -> 'T[]
10351035

1036-
/// <summary>Sorts the elements of an array, returning a new array. Elements are compared using Operators.compare. </summary>
1036+
/// <summary>Sorts the elements of an array, returning a new array. Elements are compared using <see cref="M:Microsoft.FSharp.Core.Operators.compare"/>. </summary>
10371037
///
10381038
/// <remarks>This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved.
1039-
/// For a stable sort, consider using Seq.sort.</remarks>
1039+
/// For a stable sort, consider using <see cref="M:Microsoft.FSharp.Collections.SeqModule.Sort"/>.</remarks>
10401040
///
10411041
/// <param name="array">The input array.</param>
10421042
///
@@ -1047,10 +1047,10 @@ namespace Microsoft.FSharp.Collections
10471047
val sort: array:'T[] -> 'T[] when 'T : comparison
10481048

10491049
/// <summary>Sorts the elements of an array, using the given projection for the keys and returning a new array.
1050-
/// Elements are compared using Operators.compare.</summary>
1050+
/// Elements are compared using <see cref="M:Microsoft.FSharp.Core.Operators.compare"/>.</summary>
10511051
///
10521052
/// <remarks>This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved.
1053-
/// For a stable sort, consider using Seq.sort.</remarks>
1053+
/// For a stable sort, consider using <see cref="M:Microsoft.FSharp.Collections.SeqModule.Sort"/>.</remarks>
10541054
///
10551055
/// <param name="projection">The function to transform array elements into the type that is compared.</param>
10561056
/// <param name="array">The input array.</param>
@@ -1064,7 +1064,7 @@ namespace Microsoft.FSharp.Collections
10641064
/// <summary>Sorts the elements of an array, using the given comparison function as the order, returning a new array.</summary>
10651065
///
10661066
/// <remarks>This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved.
1067-
/// For a stable sort, consider using Seq.sort.</remarks>
1067+
/// For a stable sort, consider using <see cref="M:Microsoft.FSharp.Collections.SeqModule.Sort"/>.</remarks>
10681068
///
10691069
/// <param name="comparer">The function to compare pairs of array elements.</param>
10701070
/// <param name="array">The input array.</param>
@@ -1076,10 +1076,10 @@ namespace Microsoft.FSharp.Collections
10761076
val sortWith: comparer:('T -> 'T -> int) -> array:'T[] -> 'T[]
10771077

10781078
/// <summary>Sorts the elements of an array by mutating the array in-place, using the given projection for the keys.
1079-
/// Elements are compared using Operators.compare.</summary>
1079+
/// Elements are compared using <see cref="M:Microsoft.FSharp.Core.Operators.compare"/>.</summary>
10801080
///
10811081
/// <remarks>This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved.
1082-
/// For a stable sort, consider using Seq.sort.</remarks>
1082+
/// For a stable sort, consider using <see cref="M:Microsoft.FSharp.Collections.SeqModule.Sort"/>.</remarks>
10831083
///
10841084
/// <param name="projection">The function to transform array elements into the type that is compared.</param>
10851085
/// <param name="array">The input array.</param>
@@ -1100,7 +1100,7 @@ namespace Microsoft.FSharp.Collections
11001100
val sortInPlaceWith: comparer:('T -> 'T -> int) -> array:'T[] -> unit
11011101

11021102
/// <summary>Sorts the elements of an array by mutating the array in-place, using the given comparison function.
1103-
/// Elements are compared using Operators.compare.</summary>
1103+
/// Elements are compared using <see cref="M:Microsoft.FSharp.Core.Operators.compare"/>.</summary>
11041104
///
11051105
/// <param name="array">The input array.</param>
11061106
///
@@ -1121,10 +1121,10 @@ namespace Microsoft.FSharp.Collections
11211121
[<CompiledName("SplitAt")>]
11221122
val splitAt: index:int -> array:'T[] -> ('T[] * 'T[])
11231123

1124-
/// <summary>Sorts the elements of an array, in descending order, returning a new array. Elements are compared using Operators.compare. </summary>
1124+
/// <summary>Sorts the elements of an array, in descending order, returning a new array. Elements are compared using <see cref="M:Microsoft.FSharp.Core.Operators.compare"/>. </summary>
11251125
///
11261126
/// <remarks>This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved.
1127-
/// For a stable sort, consider using Seq.sort.</remarks>
1127+
/// For a stable sort, consider using <see cref="M:Microsoft.FSharp.Collections.SeqModule.Sort"/>.</remarks>
11281128
///
11291129
/// <param name="array">The input array.</param>
11301130
///
@@ -1133,10 +1133,10 @@ namespace Microsoft.FSharp.Collections
11331133
val inline sortDescending: array:'T[] -> 'T[] when 'T : comparison
11341134

11351135
/// <summary>Sorts the elements of an array, in descending order, using the given projection for the keys and returning a new array.
1136-
/// Elements are compared using Operators.compare.</summary>
1136+
/// Elements are compared using <see cref="M:Microsoft.FSharp.Core.Operators.compare"/>.</summary>
11371137
///
11381138
/// <remarks>This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved.
1139-
/// For a stable sort, consider using Seq.sort.</remarks>
1139+
/// For a stable sort, consider using <see cref="M:Microsoft.FSharp.Collections.SeqModule.Sort"/>.</remarks>
11401140
///
11411141
/// <param name="projection">The function to transform array elements into the type that is compared.</param>
11421142
/// <param name="array">The input array.</param>
@@ -1403,21 +1403,21 @@ namespace Microsoft.FSharp.Collections
14031403
/// the array comprised of the results "x" for each element where
14041404
/// the function returns Some(x).</summary>
14051405
///
1406-
/// <remarks>Performs the operation in parallel using System.Threading.Parallel.For.
1406+
/// <remarks>Performs the operation in parallel using <see cref="M:System.Threading.Parallel.For" />.
14071407
/// The order in which the given function is applied to elements of the input array is not specified.</remarks>
14081408
///
14091409
/// <param name="chooser">The function to generate options from the elements.</param>
14101410
/// <param name="array">The input array.</param>
14111411
///
1412-
/// <returns>'U[]</returns>
1412+
/// <returns>The array of results.</returns>
14131413
///
14141414
/// <exception cref="T:System.ArgumentNullException">Thrown when the input array is null.</exception>
14151415
[<CompiledName("Choose")>]
14161416
val choose: chooser:('T -> 'U option) -> array:'T[] -> 'U[]
14171417

14181418
/// <summary>For each element of the array, apply the given function. Concatenate all the results and return the combined array.</summary>
14191419
///
1420-
/// <remarks>Performs the operation in parallel using System.Threading.Parallel.For.
1420+
/// <remarks>Performs the operation in parallel using <see cref="M:System.Threading.Parallel.For" />.
14211421
/// The order in which the given function is applied to elements of the input array is not specified.</remarks>
14221422
///
14231423
/// <param name="mapping"></param>
@@ -1432,13 +1432,13 @@ namespace Microsoft.FSharp.Collections
14321432
/// <summary>Build a new array whose elements are the results of applying the given function
14331433
/// to each of the elements of the array.</summary>
14341434
///
1435-
/// <remarks>Performs the operation in parallel using System.Threading.Parallel.For.
1435+
/// <remarks>Performs the operation in parallel using <see cref="M:System.Threading.Parallel.For" />.
14361436
/// The order in which the given function is applied to elements of the input array is not specified.</remarks>
14371437
///
14381438
/// <param name="mapping"></param>
14391439
/// <param name="array">The input array.</param>
14401440
///
1441-
/// <returns>'U[]</returns>
1441+
/// <returns>The array of results.</returns>
14421442
///
14431443
/// <exception cref="T:System.ArgumentNullException">Thrown when the input array is null.</exception>
14441444
[<CompiledName("Map")>]
@@ -1448,21 +1448,21 @@ namespace Microsoft.FSharp.Collections
14481448
/// to each of the elements of the array. The integer index passed to the
14491449
/// function indicates the index of element being transformed.</summary>
14501450
///
1451-
/// <remarks>Performs the operation in parallel using System.Threading.Parallel.For.
1451+
/// <remarks>Performs the operation in parallel using <see cref="M:System.Threading.Parallel.For" />.
14521452
/// The order in which the given function is applied to elements of the input array is not specified.</remarks>
14531453
///
14541454
/// <param name="mapping"></param>
14551455
/// <param name="array">The input array.</param>
14561456
///
1457-
/// <returns>'U[]</returns>
1457+
/// <returns>The array of results.</returns>
14581458
///
14591459
/// <exception cref="T:System.ArgumentNullException">Thrown when the input array is null.</exception>
14601460
[<CompiledName("MapIndexed")>]
14611461
val mapi: mapping:(int -> 'T -> 'U) -> array:'T[] -> 'U[]
14621462

14631463
/// <summary>Apply the given function to each element of the array. </summary>
14641464
///
1465-
/// <remarks>Performs the operation in parallel using System.Threading.Parallel.For.
1465+
/// <remarks>Performs the operation in parallel using <see cref="M:System.Threading.Parallel.For" />.
14661466
/// The order in which the given function is applied to elements of the input array is not specified.</remarks>
14671467
///
14681468
/// <param name="action"></param>
@@ -1475,7 +1475,7 @@ namespace Microsoft.FSharp.Collections
14751475
/// <summary>Apply the given function to each element of the array. The integer passed to the
14761476
/// function indicates the index of element.</summary>
14771477
///
1478-
/// <remarks>Performs the operation in parallel using System.Threading.Parallel.For.
1478+
/// <remarks>Performs the operation in parallel using <see cref="M:System.Threading.Parallel.For" />.
14791479
/// The order in which the given function is applied to elements of the input array is not specified.</remarks>
14801480
///
14811481
/// <param name="action"></param>
@@ -1487,27 +1487,27 @@ namespace Microsoft.FSharp.Collections
14871487

14881488
/// <summary>Create an array given the dimension and a generator function to compute the elements.</summary>
14891489
///
1490-
/// <remarks>Performs the operation in parallel using System.Threading.Parallel.For.
1490+
/// <remarks>Performs the operation in parallel using <see cref="M:System.Threading.Parallel.For" />.
14911491
/// The order in which the given function is applied to indices is not specified.</remarks>
14921492
///
14931493
/// <param name="count"></param>
14941494
/// <param name="initializer"></param>
14951495
///
1496-
/// <returns>'T[]</returns>
1496+
/// <returns>The array of results.</returns>
14971497
[<CompiledName("Initialize")>]
14981498
val init : count:int -> initializer:(int -> 'T) -> 'T[]
14991499

15001500
/// <summary>Split the collection into two collections, containing the
15011501
/// elements for which the given predicate returns "true" and "false"
15021502
/// respectively </summary>
15031503
///
1504-
/// <remarks>Performs the operation in parallel using System.Threading.Parallel.For.
1504+
/// <remarks>Performs the operation in parallel using <see cref="M:System.Threading.Parallel.For" />.
15051505
/// The order in which the given function is applied to indices is not specified.</remarks>
15061506
///
15071507
/// <param name="predicate">The function to test the input elements.</param>
15081508
/// <param name="array">The input array.</param>
15091509
///
1510-
/// <returns>'T[] * 'T[]</returns>
1510+
/// <returns>The two arrays of results.</returns>
15111511
///
15121512
/// <exception cref="T:System.ArgumentNullException">Thrown when the input array is null.</exception>
15131513
[<CompiledName("Partition")>]

src/fsharp/FSharp.Core/array2.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Microsoft.FSharp.Collections
88

99
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
1010
[<RequireQualifiedAccess>]
11-
/// <summary>Basic operations on 2-dimensional arrays.</summary>
11+
/// <summary>Contains operations for working with 2-dimensional arrays.</summary>
1212
///
1313
/// <remarks>
1414
/// <para>See also <a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/arrays">F# Language Guide - Arrays</a>.</para>

0 commit comments

Comments
 (0)