Подія
17 бер., 23 - 21 бер., 23
Приєднайтеся до серії нарад, щоб створити масштабовані рішення зі ШІ на основі реальних випадків використання з колегами-розробниками та експертами.
Зареєструватися заразЦей браузер більше не підтримується.
Замініть його на Microsoft Edge, щоб користуватися перевагами найновіших функцій, оновлень безпеки та технічної підтримки.
F# 4.7 adds multiple improvements to the F# language.
F# 4.7 is available in all .NET Core distributions and Visual Studio tooling. Get started with F# to learn more.
The F# 4.7 compiler introduces the ability to set your effective language version via a property in your project file:
<PropertyGroup>
<LangVersion>preview</LangVersion>
</PropertyGroup>
You can set it to the values 4.6
, 4.7
, latest
, and preview
. The default is latest
.
If you set it to preview
, your compiler will activate all F# preview features that are implemented in your compiler.
You no longer need to apply the yield
keyword in arrays, lists, sequences, or computation expressions where the type can be inferred. In the following example, both expressions required the yield
statement for each entry prior to F# 4.7:
let s = seq { 1; 2; 3; 4; 5 }
let daysOfWeek includeWeekend =
[
"Monday"
"Tuesday"
"Wednesday"
"Thursday"
"Friday"
if includeWeekend then
"Saturday"
"Sunday"
]
If you introduce a single yield
keyword, every other item must also have yield
applied to it.
Implicit yields are not activated when used in an expression that also uses yield!
to do something like flatten a sequence. You must continue to use yield
today in these cases.
In F# code involving classes, the self-identifier needs to always be explicit in member declarations. But in cases where the self-identifier is never used, it has traditionally been convention to use a double-underscore to indicate a nameless self-identifiers. You can now use a single underscore:
type C() =
member _.M() = ()
This also applies for for
loops:
for _ in 1..10 do printfn "Hello!"
Prior to F# 4.7, the indentation requirements for primary constructor and static member arguments required excessive indentation. They now only require a single indentation scope:
type OffsideCheck(a:int,
b:int, c:int,
d:int) = class end
type C() =
static member M(a:int,
b:int, c:int,
d:int) = 1
Відгук про .NET
.NET – це проект із відкритим кодом. Виберіть посилання, щоб надати відгук:
Подія
17 бер., 23 - 21 бер., 23
Приєднайтеся до серії нарад, щоб створити масштабовані рішення зі ШІ на основі реальних випадків використання з колегами-розробниками та експертами.
Зареєструватися заразНавчання
Навчальний шлях
Take your first steps with F# - Training
F# is an open-source, cross-platform programming language that makes it easy to write succinct, performant, robust, and practical code. It's a general-purpose language that enables you to create many different types of applications like Web API, Desktop, IoT, Gaming and more.
Документація
What's new in F# 4.6 - F# Guide - .NET
Get an overview of the new features available in F# 4.6.
What's new in F# 7 - F# Guide - .NET
Find information on the new features available in F# 7.
What's new in F# 6 - F# Guide - .NET
Get an overview of the new features available in F# 6.