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.



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. 


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.


At What Age Do Programmers Write Languages?

This is just one of many question that can be answered by reference to PLDB, the programming language database devised and maintained by Breck Yunits, himself the author of Scroll, an o [ ... ]

Pulumi Announces Copilot AI Management

Pulumi has announced Pulumi Copilot, an AI tool for general cloud infrastructure management. Copilot uses large language models with semantic understanding of the cloud to provide insights and control [ ... ]

More News

C book



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