Skip to content

Organize F# language guide toc/index, add F# scenarios #26804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
24ef466
Move tour to tutorials
dsyme Nov 3, 2021
4269d75
Add development tools
dsyme Nov 3, 2021
6f27eb8
add more under tools
dsyme Nov 3, 2021
bff1b3f
revise table of contents and overviews
dsyme Nov 3, 2021
9b9ed33
revise table of contents and overviews
dsyme Nov 3, 2021
b5ab745
revise table of contents and overviews
dsyme Nov 4, 2021
13f6ff5
fix issues
dsyme Nov 4, 2021
357b3ad
fix issues
dsyme Nov 4, 2021
1bd55eb
fix issues
dsyme Nov 4, 2021
048fd1a
fix issues
dsyme Nov 4, 2021
a211346
fix issues
dsyme Nov 4, 2021
c43af68
fix issues
dsyme Nov 4, 2021
698c8b6
fix issues
dsyme Nov 4, 2021
d2004ec
fix issues
dsyme Nov 4, 2021
4d341a6
fix issues
dsyme Nov 4, 2021
4e5d661
Apply suggestions from code review
dsyme Nov 4, 2021
e2bdc43
Update docs/fsharp/language-reference/index.md
dsyme Nov 4, 2021
cd175ce
fix issues
dsyme Nov 4, 2021
a763037
fix issues
dsyme Nov 4, 2021
a357fa0
fix issues
dsyme Nov 4, 2021
47c7c8f
fix issues
dsyme Nov 4, 2021
2d73ba9
Apply suggestions from code review
dsyme Nov 4, 2021
0a329bb
Apply suggestions from code review
dsyme Nov 4, 2021
17349e4
fix issues
dsyme Nov 4, 2021
c6e5e52
rejig azure services
dsyme Nov 4, 2021
fb5947f
rejig azure services
dsyme Nov 4, 2021
ba98537
rejig message
dsyme Nov 4, 2021
f2db70b
fix redirect
dsyme Nov 4, 2021
8d3ebe2
add link
dsyme Nov 4, 2021
15cf8b3
Update docs/fsharp/using-fsharp-on-azure/deploying-and-managing.md
dsyme Nov 4, 2021
2a335f4
Update docs/fsharp/using-fsharp-on-azure/deploying-and-managing.md
dsyme Nov 4, 2021
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
12 changes: 10 additions & 2 deletions .openpublishing.redirection.json
Original file line number Diff line number Diff line change
Expand Up @@ -12971,6 +12971,10 @@
"source_path": "docs/fsharp/language-reference/asynchronous-workflows.md",
"redirect_url": "/dotnet/fsharp/docs/fsharp/language-reference/async-expressions"
},
{
"source_path": "docs/fsharp/language-reference/structures.md",
"redirect_url": "/dotnet/fsharp/docs/fsharp/language-reference/structs"
},
{
"source_path": "docs/fsharp/getting-started-netcore.md",
"redirect_url": "/dotnet/fsharp/get-started/get-started-command-line"
Expand Down Expand Up @@ -13091,11 +13095,15 @@
},
{
"source_path": "docs/fsharp/using-fsharp-on-azure/using-fsharp-on-azure-service-fabric.md",
"redirect_url": "/dotnet/fsharp/using-fsharp-on-azure/index"
"redirect_url": "/dotnet/fsharp"
},
{
"source_path": "docs/fsharp/using-fsharp-on-azure/package-management.md",
"redirect_url": "/dotnet/fsharp/using-fsharp-on-azure/index"
"redirect_url": "/dotnet/fsharp"
},
{
"source_path": "docs/fsharp/using-fsharp-on-azure/index.md",
"redirect_url": "/dotnet/fsharp"
},
{
"source_path": "docs/fsharp/whats-new/index.md",
Expand Down
4 changes: 2 additions & 2 deletions docs/fsharp/get-started/get-started-visual-studio.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ Congratulations! You've created your first F# project in Visual Studio, written

## Next steps

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.
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.

> [!div class="nextstepaction"]
> [Tour of F#](../tour.md)

## See also

- [F# language reference](../language-reference/index.md)
- [F# language guide](../language-reference/index.md)
- [Type inference](../language-reference/type-inference.md)
- [Symbol and operator reference](../language-reference/symbol-and-operator-reference/index.md)
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ This is only a glimpse into what you can do with F# Interactive. To learn more,

## Next steps

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).
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).

## See also

- [F# guide](../index.yml)
- [Tour of F#](../tour.md)
- [F# language reference](../language-reference/index.md)
- [F# language guide](../language-reference/index.md)
- [Type inference](../language-reference/type-inference.md)
- [Symbol and operator reference](../language-reference/symbol-and-operator-reference/index.md)
118 changes: 72 additions & 46 deletions docs/fsharp/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
ms.topic: landing-page # Required
author: cartermp
ms.author: phcart
ms.date: 10/29/2021
ms.date: 11/03/2021

landingContent:
- title: "Learn to program in F#"
Expand Down Expand Up @@ -37,75 +37,101 @@ landingContent:
- text: Download the .NET SDK
url: https://dotnet.microsoft.com/download

- title: "F# language guide"
linkLists:
- linkListType: overview
links:
- text: "F# language guide"
url: language-reference/index.md
- linkListType: reference
links:
- text: "F# language specification"
url: https://fsharp.org/specs/language-spec/
- text: "F# RFCs"
url: https://github.com/fsharp/fslang-design
- text: "F# library reference"
url: https://fsharp.github.io/fsharp-core-docs
- text: ".NET library reference"
url: ../../api/index.md?view=net-6.0

- title: "F# fundamentals"
linkLists:
- linkListType: overview
links:
- text: "Overview"
url: language-reference/index.md
- text: "Tour of F#"
url: tour.md
- text: "Values"
url: language-reference/values/index.md
- linkListType: concept
links:
- text: "F# style guide"
url: style-guide/index.md
- text: "F# code formatting guidelines"
url: style-guide/formatting.md
- text: "F# coding conventions"
url: style-guide/conventions.md
- text: "Types and inference"
url: language-reference/fsharp-types.md
- text: "Functional concepts"
url: tutorials/functional-programming-concepts.md
- text: "Type providers"
url: tutorials/type-providers/index.md
- linkListType: tutorial
links:
- text: "Functional programming concepts in F#"
url: tutorials/functional-programming-concepts.md
- text: "Using Functions in F#"
- text: "Using Functions"
url: tutorials/using-functions.md
- text: "Async programming in F#"
- text: "Pattern matching"
url: language-reference/pattern-matching.md
- text: "Object programming"
url: language-reference/index.md#object-programming
- text: "Async programming"
url: tutorials/async.md
- text: "Type providers"
url: tutorials/type-providers/index.md

- title: "New features in F#"
- title: "F# in practice"
linkLists:
- linkListType: whats-new
- linkListType: overview
links:
- text: "What's new in F# 6"
url: whats-new/fsharp-6.md
- text: "What's new in F# 5"
url: whats-new/fsharp-50.md
- text: "What's new in F# 4.7"
url: whats-new/fsharp-47.md
- text: "What's new in F# 4.6"
url: whats-new/fsharp-46.md
- text: "What's new in F# 4.5"
url: whats-new/fsharp-45.md

- title: "F# language reference"
linkLists:
- linkListType: reference
- text: "F# for web development"
url: scenarios/web-development.md
- text: "F# for machine learning"
url: scenarios/machine-learning.md
- text: "F# for Apache Spark on Azure"
url: using-fsharp-on-azure/apache-spark.md
- text: "F# for deploying Azure resources"
url: using-fsharp-on-azure/deploying-and-managing.md
- linkListType: learn
links:
- text: "Language reference"
url: language-reference/index.md
- text: "Keyword reference"
url: language-reference/keyword-reference.md
- text: "Symbol and operator reference"
url: language-reference/symbol-and-operator-reference/index.md
- text: "Functions"
url: language-reference/functions/index.md
- text: "Types"
url: language-reference/fsharp-types.md
- text: "F# style guide"
url: style-guide/index.md
- text: "F# code formatting guidelines"
url: style-guide/formatting.md
- text: "F# coding conventions"
url: style-guide/conventions.md

- title: "F# tools"
linkLists:
- linkListType: reference
- linkListType: overview
links:
- text: "F# Interactive"
url: tools/fsharp-interactive/index.md
- text: "F# development tools"
url: https://dotnet.microsoft.com/languages/fsharp/tools
- text: "F# notebooks"
url: tools/notebooks.md
- text: "F# for JavaScript"
url: tools/javascript.md

- title: "F# library reference"
- title: "New features in F#"
linkLists:
- linkListType: reference
- linkListType: whats-new
links:
- text: "F# core library reference"
url: https://fsharp.github.io/fsharp-core-docs
- text: ".NET library reference"
url: ../../api/index.md?view=net-5.0
- text: "What's new in F# 6"
url: whats-new/fsharp-6.md
- text: "What's new in F# 5"
url: whats-new/fsharp-50.md
- text: "What's new in F# 4.7"
url: whats-new/fsharp-47.md
- linkListType: tutorial
links:
- text: "Explore tasks"
url: language-reference\task-expressions.md
- text: "Explore interpolated strings"
url: language-reference\interpolated-strings.md
- text: "Explore anonymous records"
url: language-reference\anonymous-records.md
2 changes: 1 addition & 1 deletion docs/fsharp/language-reference/abstract-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract member member-name : type-signature

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.

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).
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).

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.

Expand Down
4 changes: 2 additions & 2 deletions docs/fsharp/language-reference/anonymous-records.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Anonymous Records
description: Learn how to use construct and use Anonymous Records, a language feature that helps with the manipulation of data.
ms.date: 06/12/2019
description: Learn how to construct and use anonymous records, a language feature that helps with the manipulation of data.
ms.date: 11/04/2021
---
# Anonymous Records

Expand Down
2 changes: 1 addition & 1 deletion docs/fsharp/language-reference/async-expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ F# async expressions don't support asynchronous `try .. finally ..`. You can use

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

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.
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.

## Asynchronous Primitives

Expand Down
4 changes: 2 additions & 2 deletions docs/fsharp/language-reference/basic-types.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: Basic Types
description: Discover the fundamental basic types that are used in the F# language.
description: Discover the fundamental basic types that are used in F#.
ms.date: 08/15/2020
---
# Basic types

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.
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.

|Type|.NET type|Description|Example|
|----|---------|-----------|-------|
Expand Down
2 changes: 1 addition & 1 deletion docs/fsharp/language-reference/byrefs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ms.date: 11/04/2019
F# has two major feature areas that deal in the space of low-level programming:

* 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.
* 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>.
* 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>.

## Syntax

Expand Down
2 changes: 1 addition & 1 deletion docs/fsharp/language-reference/classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ If you are not interoperating closely with object-oriented code, or if you are w

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).

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).
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).

## See also

Expand Down
14 changes: 2 additions & 12 deletions docs/fsharp/language-reference/compiler-directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ f1_keywords:

This topic describes processor directives and compiler directives.

For F# Interactive (`dotnet fsi`) directives, see [Interactive Programming with F#](../tools/fsharp-interactive/index.md).

## Preprocessor Directives

A preprocessor directive is prefixed with the # symbol and appears on a line by itself. It is interpreted by the preprocessor, which runs before the compiler itself.
Expand Down Expand Up @@ -62,18 +64,6 @@ When you use the `#line` directive, file names must be enclosed in quotation mar

These tokens indicate that the F# code generated at this location is derived from some constructs at or near line `25` in `Script1`.

## Compiler Directives

Compiler directives resemble preprocessor directives, because they are prefixed with a # sign, but instead of being interpreted by the preprocessor, they are left for the compiler to interpret and act on.

The following table lists the compiler directive that is available in F#.

|Directive|Description|
|---------|-----------|
|`#light` ["on"&#124;"off"]|Enables or disables lightweight syntax, for compatibility with other versions of ML. By default, lightweight syntax is enabled. Verbose syntax is always enabled. Therefore, you can use both lightweight syntax and verbose syntax. The directive `#light` by itself is equivalent to `#light "on"`. If you specify `#light "off"`, you must use verbose syntax for all language constructs. Syntax in the documentation for F# is presented with the assumption that you are using lightweight syntax. For more information, see [Verbose Syntax](verbose-syntax.md).|

For interpreter (fsi.exe) directives, see [Interactive Programming with F#](../tools/fsharp-interactive/index.md).

## See also

- [F# Language Reference](index.md)
Expand Down
Loading