F# Adds Anonymous Records
Written by Kay Ewbank   
Thursday, 11 April 2019

F# 4.6 has been released with the addition of support for anonymous records. The new version of F# will be included in Visual Studio 2019 when it ships.

F# is now developed by a combination of Microsoft (who remain the main driver behind the language), and open-source community developers. F# provides support for functional programming as well as supporting traditional object-oriented and imperative (procedural) programming. F# 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# Open Source Group.

fsharp

 

The main improvement to this release of F# is support for anonymous records. These are record types that don’t have explicit names and that can be declared in an ad-hoc fashion. The F# team says that they can be used for succinct data manipulation that was not previously possible.

They also make it easier to use LINQ (Language INtegrated Query). Until now this has been difficult because LINQ uses C# anonymous types, but is now possible using anonymous records, so providing an alternative to using the List, Array, and Sequence combinators when working with data.

The F# Core Library has also been improved for this version. The ValueOption type that was introduced in F# 4.5 has been expanded with new members including IsNone, IsSome, None, Some and ToString. These additions give ValueOption parity with the Option type in terms of members. There's also now a ValueOption module that has the same functions the Option module has.

The developers have also worked on the F# tools to improve their performance for larger solutions consisting of multiple projects. In the past, the F# compiler and tools haven't performed well with large solutions, using a lot of memory and CPU. The developers looked at where the tools and compiler was a heavy used of Large Object Heap allocations, and what could be done to mitigate this. Other work included significant reductions in cache sizes, significant reductions in allocations when processing format strings, removing ambient processing of identifiers for suggestions when encountering a compile error, removing LOH allocations for F# symbols when they are finished being typechecked, and removing some unnecessary boxing of value types that are used in lots of IDE features.

The improvements should mean that F# users with medium to large solutions (50+ projects) should see performance improvements, especially over long stretches of work. 

fsharp

More Information

FSharp Organization

Related Articles

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

Visual Studio 2015 Launched - Any App Any Developer

Full Visual Studio Now Free

Not Dumping .NET - Microsoft's Method

Microsoft Open Sources .NET?

 

 

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


Insights From AI Index 2024 Report
17/04/2024

Published this week, the latest Stanford HAI AI Index report tracks worldwide trends in AI. A mix of its new research and findings from many other sources, it provides a wide ranging look at how  [ ... ]



Rust Twice As Productive As C++
03/04/2024

Google director of engineering, Lars Bergstrom, gave a talk at the recent Rust Nation UK conference and claimed that Rust was twice as productive as C++. Given how good Google is at C++, this is quite [ ... ]


More News

raspberry pi books

 

Comments




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