-
Notifications
You must be signed in to change notification settings - Fork 6k
Add comprehensive documentation for F# 7 and F# 8 features #49119
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: BillWagner <[email protected]>
Co-authored-by: BillWagner <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ready for final review.
This is a great start @copilot Can you make the same changes for F# 8? The content from the relevant blog post should be included into the "What's new" article, instead of linked. |
Co-authored-by: BillWagner <[email protected]>
Done! F# 8 documentation has been updated with comprehensive feature documentation in commit 6f1f4e6. |
Co-authored-by: BillWagner <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now ready for final review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses the missing comprehensive documentation for F# 7 and F# 8 by creating detailed feature documentation that follows the same structure and style as F# 9, replacing simple blog post links with proper documentation.
- Expanded F# 7 documentation from 9 lines to 158 lines covering static abstract members, required members, simplified SRTP syntax, nested record updates, and performance improvements
- Created comprehensive F# 8 documentation with 147 lines covering shortened lambda expressions, while! in computation expressions, enhanced pattern matching, and tooling enhancements
- Updated .NET version overview pages to link to the new comprehensive documentation instead of external blog posts
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
docs/fsharp/whats-new/fsharp-7.md | Comprehensive F# 7 feature documentation with code examples and cross-references |
docs/fsharp/whats-new/fsharp-8.md | Detailed F# 8 feature documentation following the same structure as F# 7 |
docs/core/whats-new/dotnet-7.md | Updated F# 7 section to link to new comprehensive documentation |
docs/core/whats-new/dotnet-8/overview.md | Added F# 8 section linking to new comprehensive documentation |
while! stream.AsyncRead(buffer, 0, buffer.Length) do | ||
// Process buffer | ||
processBuffer buffer bytesRead |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable bytesRead
is referenced but not defined in the while!
example. The while!
condition returns the bytes read, but it's not captured in a variable that can be used in the loop body.
while! stream.AsyncRead(buffer, 0, buffer.Length) do | |
// Process buffer | |
processBuffer buffer bytesRead | |
let rec loop () = async { | |
let! bytesRead = stream.AsyncRead(buffer, 0, buffer.Length) | |
if bytesRead <> 0 then | |
// Process buffer | |
processBuffer buffer bytesRead | |
return! loop () | |
else | |
return () | |
} | |
do! loop () |
Copilot uses AI. Check for mistakes.
let inline addAll (items: 'T list) = | ||
items |> List.fold (+) 'T.Zero |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syntax 'T.Zero
is incorrect for accessing static members in F#. It should be ^T.Zero
to properly reference the static member from the type parameter.
let inline addAll (items: 'T list) = | |
items |> List.fold (+) 'T.Zero | |
let inline addAll (items: ^T list) = | |
items |> List.fold (+) ^T.Zero |
Copilot uses AI. Check for mistakes.
let inline sum (values: ^T list) : ^T | ||
when ^T : (static member (+) : ^T * ^T -> ^T) | ||
and ^T : (static member Zero : ^T) = | ||
List.fold (+) (^T.Zero()) values |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syntax ^T.Zero()
is incorrect - Zero
should be a property, not a method call. It should be ^T.Zero
without parentheses.
List.fold (+) (^T.Zero()) values | |
List.fold (+) ^T.Zero values |
Copilot uses AI. Check for mistakes.
Fixes #43996
Summary
This PR addresses the missing documentation for F# 7 and F# 8 by creating comprehensive documentation that follows the same structure and style as F# 9, rather than simply linking to blog posts.
Changes
New F# 7 Documentation (
docs/fsharp/whats-new/fsharp-7.md
)Expanded the F# 7 documentation from 9 lines (containing only a blog post link) to 164 lines of detailed feature documentation, including:
'a.Zero()
without repeating constraintsAll sections include practical code examples and cross-references to related documentation.
New F# 8 Documentation (
docs/fsharp/whats-new/fsharp-8.md
)Expanded the F# 8 documentation from 9 lines (containing only a blog post link) to 147 lines of detailed feature documentation, including:
_.Property
instead offun x -> x.Property
)while!
in computation expressions - New keyword for async operations in while loops, reducing boilerplateAll sections include practical code examples and cross-references to related documentation.
Updated .NET 7 Overview (
docs/core/whats-new/dotnet-7.md
)Changed the F# 7 section to link to the new comprehensive documentation instead of the external blog post, providing a consistent experience with other .NET language documentation.
Updated .NET 8 Overview (
docs/core/whats-new/dotnet-8/overview.md
)Added an F# 8 section to link to the new comprehensive documentation, maintaining consistency with the .NET 7 overview and other language sections.
Documentation Standards
ai-usage: ai-assisted
frontmatter as requiredThis change ensures developers can find complete F# 7 and F# 8 feature documentation directly in the official docs without needing to locate external blog posts.
Fixes #33166
Fixes #33166
Original prompt
Fixes #33166
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Internal previews