|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.
or email your comment to: firstname.lastname@example.org