United Kingdom: +44 (0)208 088 8978

New F# Language Features That Will Improve Your Code

The F# universe is constantly evolving, and one key area you should be aware of is the language itself. Read on to learn about changes every F# developer should know about.

In 2019, most of the work on the migration of F# to .NET Core was completed, meaning that work on F# the language restarted. A number of new features were added to the core language with the releases of F# 4.6 and 4.7, and we see good indications that this trend of carefully and tastefully selected new language features will continue in 2020 and beyond.

Tip 1

Among the most notable new features is implicit yields. This generally improves readability when generating collections with conditional logic, particularly when working with SAFE Stack applications where the front-end follows the increasingly popular Elmish MVU design pattern.

Tip 2

Another enhancement was the introduction of anonymous records, which provide a number of ways to reduce boilerplate and improve interop with external systems such as JavaScript and SQL. Even better, perhaps, they also allow some interesting new design patterns in F#, such as creating supersets of existing records. We feel that it would be interesting to see this feature evolve further in the future, perhaps allowing users to create subsets of records, or even to create supersets of types based on other type definitions.

To learn about more recent improvements to the F# language, and to find out which we recommend you adopt and reject, download Compositional IT’s new whitepaper, F# In 2020: The Road Ahead.