Skip to content

Commit d93c253

Browse files
authored
Merge pull request #26804 from dsyme/f7
Organize F# language guide toc/index, add F# scenarios
2 parents 5de01ef + 2a335f4 commit d93c253

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+891
-614
lines changed

.openpublishing.redirection.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12995,6 +12995,10 @@
1299512995
"source_path": "docs/fsharp/language-reference/asynchronous-workflows.md",
1299612996
"redirect_url": "/dotnet/fsharp/docs/fsharp/language-reference/async-expressions"
1299712997
},
12998+
{
12999+
"source_path": "docs/fsharp/language-reference/structures.md",
13000+
"redirect_url": "/dotnet/fsharp/docs/fsharp/language-reference/structs"
13001+
},
1299813002
{
1299913003
"source_path": "docs/fsharp/getting-started-netcore.md",
1300013004
"redirect_url": "/dotnet/fsharp/get-started/get-started-command-line"
@@ -13115,11 +13119,15 @@
1311513119
},
1311613120
{
1311713121
"source_path": "docs/fsharp/using-fsharp-on-azure/using-fsharp-on-azure-service-fabric.md",
13118-
"redirect_url": "/dotnet/fsharp/using-fsharp-on-azure/index"
13122+
"redirect_url": "/dotnet/fsharp"
1311913123
},
1312013124
{
1312113125
"source_path": "docs/fsharp/using-fsharp-on-azure/package-management.md",
13122-
"redirect_url": "/dotnet/fsharp/using-fsharp-on-azure/index"
13126+
"redirect_url": "/dotnet/fsharp"
13127+
},
13128+
{
13129+
"source_path": "docs/fsharp/using-fsharp-on-azure/index.md",
13130+
"redirect_url": "/dotnet/fsharp"
1312313131
},
1312413132
{
1312513133
"source_path": "docs/fsharp/whats-new/index.md",

docs/fsharp/get-started/get-started-visual-studio.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ Congratulations! You've created your first F# project in Visual Studio, written
5858

5959
## Next steps
6060

61-
If you haven't already, check out the [Tour of F#](../tour.md), which covers some of the core features of the F# language. It provides an overview of some of the capabilities of F# and ample code samples that you can copy into Visual Studio and run.
61+
If you haven't already, check out the [Tour of F#](../tour.md), which covers some of the core features of F#. It provides an overview of some of the capabilities of F# and ample code samples that you can copy into Visual Studio and run.
6262

6363
> [!div class="nextstepaction"]
6464
> [Tour of F#](../tour.md)
6565
6666
## See also
6767

68-
- [F# language reference](../language-reference/index.md)
68+
- [F# language guide](../language-reference/index.md)
6969
- [Type inference](../language-reference/type-inference.md)
7070
- [Symbol and operator reference](../language-reference/symbol-and-operator-reference/index.md)

docs/fsharp/get-started/get-started-with-visual-studio-for-mac.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ This is only a glimpse into what you can do with F# Interactive. To learn more,
105105

106106
## Next steps
107107

108-
If you haven't already, check out the [Tour of F#](../tour.md), which covers some of the core features of the F# language. It will give you an overview of some of the capabilities of F#, and provide ample code samples that you can copy into Visual Studio for Mac and run. There are also some great external resources you can use, showcased in the [F# Guide](../index.yml).
108+
If you haven't already, check out the [Tour of F#](../tour.md), which covers some of the core features of F#. It will give you an overview of some of the capabilities of F#, and provide ample code samples that you can copy into Visual Studio for Mac and run. There are also some great external resources you can use, showcased in the [F# Guide](../index.yml).
109109

110110
## See also
111111

112112
- [F# guide](../index.yml)
113113
- [Tour of F#](../tour.md)
114-
- [F# language reference](../language-reference/index.md)
114+
- [F# language guide](../language-reference/index.md)
115115
- [Type inference](../language-reference/type-inference.md)
116116
- [Symbol and operator reference](../language-reference/symbol-and-operator-reference/index.md)

docs/fsharp/index.yml

Lines changed: 72 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
ms.topic: landing-page # Required
1010
author: cartermp
1111
ms.author: phcart
12-
ms.date: 10/29/2021
12+
ms.date: 11/03/2021
1313

1414
landingContent:
1515
- title: "Learn to program in F#"
@@ -37,75 +37,101 @@ landingContent:
3737
- text: Download the .NET SDK
3838
url: https://dotnet.microsoft.com/download
3939

40+
- title: "F# language guide"
41+
linkLists:
42+
- linkListType: overview
43+
links:
44+
- text: "F# language guide"
45+
url: language-reference/index.md
46+
- linkListType: reference
47+
links:
48+
- text: "F# language specification"
49+
url: https://fsharp.org/specs/language-spec/
50+
- text: "F# RFCs"
51+
url: https://github.com/fsharp/fslang-design
52+
- text: "F# library reference"
53+
url: https://fsharp.github.io/fsharp-core-docs
54+
- text: ".NET library reference"
55+
url: ../../api/index.md?view=net-6.0
56+
4057
- title: "F# fundamentals"
4158
linkLists:
4259
- linkListType: overview
4360
links:
61+
- text: "Overview"
62+
url: language-reference/index.md
4463
- text: "Tour of F#"
4564
url: tour.md
65+
- text: "Values"
66+
url: language-reference/values/index.md
4667
- linkListType: concept
4768
links:
48-
- text: "F# style guide"
49-
url: style-guide/index.md
50-
- text: "F# code formatting guidelines"
51-
url: style-guide/formatting.md
52-
- text: "F# coding conventions"
53-
url: style-guide/conventions.md
69+
- text: "Types and inference"
70+
url: language-reference/fsharp-types.md
71+
- text: "Functional concepts"
72+
url: tutorials/functional-programming-concepts.md
73+
- text: "Type providers"
74+
url: tutorials/type-providers/index.md
5475
- linkListType: tutorial
5576
links:
56-
- text: "Functional programming concepts in F#"
57-
url: tutorials/functional-programming-concepts.md
58-
- text: "Using Functions in F#"
77+
- text: "Using Functions"
5978
url: tutorials/using-functions.md
60-
- text: "Async programming in F#"
79+
- text: "Pattern matching"
80+
url: language-reference/pattern-matching.md
81+
- text: "Object programming"
82+
url: language-reference/index.md#object-programming
83+
- text: "Async programming"
6184
url: tutorials/async.md
62-
- text: "Type providers"
63-
url: tutorials/type-providers/index.md
6485

65-
- title: "New features in F#"
86+
- title: "F# in practice"
6687
linkLists:
67-
- linkListType: whats-new
88+
- linkListType: overview
6889
links:
69-
- text: "What's new in F# 6"
70-
url: whats-new/fsharp-6.md
71-
- text: "What's new in F# 5"
72-
url: whats-new/fsharp-50.md
73-
- text: "What's new in F# 4.7"
74-
url: whats-new/fsharp-47.md
75-
- text: "What's new in F# 4.6"
76-
url: whats-new/fsharp-46.md
77-
- text: "What's new in F# 4.5"
78-
url: whats-new/fsharp-45.md
79-
80-
- title: "F# language reference"
81-
linkLists:
82-
- linkListType: reference
90+
- text: "F# for web development"
91+
url: scenarios/web-development.md
92+
- text: "F# for machine learning"
93+
url: scenarios/machine-learning.md
94+
- text: "F# for Apache Spark on Azure"
95+
url: using-fsharp-on-azure/apache-spark.md
96+
- text: "F# for deploying Azure resources"
97+
url: using-fsharp-on-azure/deploying-and-managing.md
98+
- linkListType: learn
8399
links:
84-
- text: "Language reference"
85-
url: language-reference/index.md
86-
- text: "Keyword reference"
87-
url: language-reference/keyword-reference.md
88-
- text: "Symbol and operator reference"
89-
url: language-reference/symbol-and-operator-reference/index.md
90-
- text: "Functions"
91-
url: language-reference/functions/index.md
92-
- text: "Types"
93-
url: language-reference/fsharp-types.md
100+
- text: "F# style guide"
101+
url: style-guide/index.md
102+
- text: "F# code formatting guidelines"
103+
url: style-guide/formatting.md
104+
- text: "F# coding conventions"
105+
url: style-guide/conventions.md
94106

95107
- title: "F# tools"
96108
linkLists:
97-
- linkListType: reference
109+
- linkListType: overview
98110
links:
99111
- text: "F# Interactive"
100112
url: tools/fsharp-interactive/index.md
101113
- text: "F# development tools"
102114
url: https://dotnet.microsoft.com/languages/fsharp/tools
115+
- text: "F# notebooks"
116+
url: tools/notebooks.md
117+
- text: "F# for JavaScript"
118+
url: tools/javascript.md
103119

104-
- title: "F# library reference"
120+
- title: "New features in F#"
105121
linkLists:
106-
- linkListType: reference
122+
- linkListType: whats-new
107123
links:
108-
- text: "F# core library reference"
109-
url: https://fsharp.github.io/fsharp-core-docs
110-
- text: ".NET library reference"
111-
url: ../../api/index.md?view=net-5.0
124+
- text: "What's new in F# 6"
125+
url: whats-new/fsharp-6.md
126+
- text: "What's new in F# 5"
127+
url: whats-new/fsharp-50.md
128+
- text: "What's new in F# 4.7"
129+
url: whats-new/fsharp-47.md
130+
- linkListType: tutorial
131+
links:
132+
- text: "Explore tasks"
133+
url: language-reference\task-expressions.md
134+
- text: "Explore interpolated strings"
135+
url: language-reference\interpolated-strings.md
136+
- text: "Explore anonymous records"
137+
url: language-reference\anonymous-records.md

docs/fsharp/language-reference/abstract-classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ abstract member member-name : type-signature
2424

2525
In object-oriented programming, an abstract class is used as a base class of a hierarchy, and represents common functionality of a diverse set of object types. As the name "abstract" implies, abstract classes often do not correspond directly onto concrete entities in the problem domain. However, they do represent what many different concrete entities have in common.
2626

27-
Abstract classes must have the `AbstractClass` attribute. They can have implemented and unimplemented members. The use of the term *abstract* when applied to a class is the same as in other .NET languages; however, the use of the term *abstract* when applied to methods (and properties) is a little different in F# from its use in other .NET languages. In F#, when a method is marked with the `abstract` keyword, this indicates that a member has an entry, known as a *virtual dispatch slot*, in the internal table of virtual functions for that type. In other words, the method is virtual, although the `virtual` keyword is not used in the F# language. The keyword `abstract` is used on virtual methods regardless of whether the method is implemented. The declaration of a virtual dispatch slot is separate from the definition of a method for that dispatch slot. Therefore, the F# equivalent of a virtual method declaration and definition in another .NET language is a combination of both an abstract method declaration and a separate definition, with either the `default` keyword or the `override` keyword. For more information and examples, see [Methods](./members/methods.md).
27+
Abstract classes must have the `AbstractClass` attribute. They can have implemented and unimplemented members. The use of the term *abstract* when applied to a class is the same as in other .NET languages; however, the use of the term *abstract* when applied to methods (and properties) is a little different in F# from its use in other .NET languages. In F#, when a method is marked with the `abstract` keyword, this indicates that a member has an entry, known as a *virtual dispatch slot*, in the internal table of virtual functions for that type. In other words, the method is virtual, although the `virtual` keyword is not used in F#. The keyword `abstract` is used on virtual methods regardless of whether the method is implemented. The declaration of a virtual dispatch slot is separate from the definition of a method for that dispatch slot. Therefore, the F# equivalent of a virtual method declaration and definition in another .NET language is a combination of both an abstract method declaration and a separate definition, with either the `default` keyword or the `override` keyword. For more information and examples, see [Methods](./members/methods.md).
2828

2929
A class is considered abstract only if there are abstract methods that are declared but not defined. Therefore, classes that have abstract methods are not necessarily abstract classes. Unless a class has undefined abstract methods, do not use the **AbstractClass** attribute.
3030

docs/fsharp/language-reference/anonymous-records.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Anonymous Records
3-
description: Learn how to use construct and use Anonymous Records, a language feature that helps with the manipulation of data.
4-
ms.date: 06/12/2019
3+
description: Learn how to construct and use anonymous records, a language feature that helps with the manipulation of data.
4+
ms.date: 11/04/2021
55
---
66
# Anonymous Records
77

docs/fsharp/language-reference/async-expressions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ F# async expressions don't support asynchronous `try .. finally ..`. You can use
5050

5151
Within async expressions, `use` bindings can bind to values of type <xref:System.IDisposable>. For the latter, the disposal cleanup operation is executed asynchronously.
5252

53-
In addition to `let!`, you can use `use!` to perform asynchronous bindings. The difference between `let!` and `use!` is the same as the difference between `let` and `use`. For `use!`, the object is disposed of at the close of the current scope. Note that in the current release of the F# language, `use!` does not allow a value to be initialized to null, even though `use` does.
53+
In addition to `let!`, you can use `use!` to perform asynchronous bindings. The difference between `let!` and `use!` is the same as the difference between `let` and `use`. For `use!`, the object is disposed of at the close of the current scope. Note that in the current release of F#, `use!` does not allow a value to be initialized to null, even though `use` does.
5454

5555
## Asynchronous Primitives
5656

docs/fsharp/language-reference/basic-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: Basic Types
3-
description: Discover the fundamental basic types that are used in the F# language.
3+
description: Discover the fundamental basic types that are used in F#.
44
ms.date: 08/15/2020
55
---
66
# Basic types
77

8-
This topic lists the basic types that are defined in the F# language. These types are the most fundamental in F#, forming the basis of nearly every F# program. They are a superset of .NET primitive types.
8+
This topic lists the basic types that are defined in F#. These types are the most fundamental in F#, forming the basis of nearly every F# program. They are a superset of .NET primitive types.
99

1010
|Type|.NET type|Description|Example|
1111
|----|---------|-----------|-------|

docs/fsharp/language-reference/byrefs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.date: 11/04/2019
88
F# has two major feature areas that deal in the space of low-level programming:
99

1010
* The `byref`/`inref`/`outref` types, which are managed pointers. They have restrictions on usage so that you cannot compile a program that is invalid at run time.
11-
* A `byref`-like struct, which is a [structure](structures.md) that has similar semantics and the same compile-time restrictions as `byref<'T>`. One example is <xref:System.Span%601>.
11+
* A `byref`-like struct, which is a [struct](structs.md) that has similar semantics and the same compile-time restrictions as `byref<'T>`. One example is <xref:System.Span%601>.
1212

1313
## Syntax
1414

docs/fsharp/language-reference/classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ If you are not interoperating closely with object-oriented code, or if you are w
125125

126126
Records have the advantage of being simpler than classes, but records are not appropriate when the demands of a type exceed what can be accomplished with their simplicity. Records are basically simple aggregates of values, without separate constructors that can perform custom actions, without hidden fields, and without inheritance or interface implementations. Although members such as properties and methods can be added to records to make their behavior more complex, the fields stored in a record are still a simple aggregate of values. For more information about records, see [Records](records.md).
127127

128-
Structures are also useful for small aggregates of data, but they differ from classes and records in that they are .NET value types. Classes and records are .NET reference types. The semantics of value types and reference types are different in that value types are passed by value. This means that they are copied bit for bit when they are passed as a parameter or returned from a function. They are also stored on the stack or, if they are used as a field, embedded inside the parent object instead of stored in their own separate location on the heap. Therefore, structures are appropriate for frequently accessed data when the overhead of accessing the heap is a problem. For more information about structures, see [Structures](structures.md).
128+
Structures are also useful for small aggregates of data, but they differ from classes and records in that they are .NET value types. Classes and records are .NET reference types. The semantics of value types and reference types are different in that value types are passed by value. This means that they are copied bit for bit when they are passed as a parameter or returned from a function. They are also stored on the stack or, if they are used as a field, embedded inside the parent object instead of stored in their own separate location on the heap. Therefore, structures are appropriate for frequently accessed data when the overhead of accessing the heap is a problem. For more information about structures, see [Structs](structs.md).
129129

130130
## See also
131131

0 commit comments

Comments
 (0)