F# 8 Makes Code More Uniform And Performant
Thursday, 23 November 2023

Microsoft has released the latest version of F#, with changes the team says makes F# programs simpler, more uniform and more performant. The new version also has faster project compilation and upgrades to the FSharp.Core standard library.

F# 8 is part of the .NET 8 release, and is also included with new updates of Visual Studio 2022 and .NET 8 SDK.

F# is developed by a combination of Microsoft, which remains the main driver behind the language, and open-source community developers. It provides support for functional programming, and runs on Linux, Mac OS X, Android, iOS, Windows, GPUs, and browsers. Microsoft includes Visual F# in Visual Studio, and the language is also open source under an OSS-approved license and is available across multiple platforms through the F# Software Foundation.

fsharp

Among the language improvements, the developers highlighted a new shorthand for defining simple lambda functions. They say this will be useful for situations when you only need an atomic expression (with no whitespace) on the lambda argument. The addition works for single property access, nested property access, method calls and indexers.

F#8 also has a new copy-and-update enhancement for nested records that avoids the need to write multiple nested with keywords, instead allowing you to use the dot-notation to reach to lower levels of nested records and update those. The new syntax allows copy-and-updating multiple fields using the same expression, and each copy-and-update within the same expression can be on a different level of nesting. The same syntax extension can be used on anonymous records, or when updating regular records into anonymous ones.

This release also adds a while! (while bang) feature that simplifies the usage of computation expressions when looping over a boolean condition that has to be evaluated by the computation expression first, such as inside an async{} block.

Other language improvements include an interpolated raw string literals inspired by the similar feature in C#. This improves the support for existing interpolated strings in F# by allowing the combination of literal text output with values and expressions by wrapping them into a pair of braces {}.

F#8 is available now as part of .NET 8.

fsharp

More Information

F# On GitHub

F# Software Foundation

F# On .NET

Related Articles

C# 9 and F# 5 Released With .NET 5

F# Adds Anonymous Record

F# 4.5 Adds Span Support

F# 4.0 Signals A Culture Change

F# 4.0 Preview

Update for Try F#

F# 3.0 - Worth A Try

F# is Open Source - sort of

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


ACM Adopts Open Access Publishing Model
05/04/2024

ACM, the Association for Computing Machinery, the professional body for computer scientists, has relaunched Communications of the ACM, the organization’s flagship magazine, as a web-first  [ ... ]



Huawei Intends To Challenge iOS and Android
24/04/2024

Huawei has just changed its mind and decided to push its HarmonyOS to the rest of the world. A challenger to iOS and Android would be nice, but it is possible?


More News

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Thursday, 23 November 2023 )