BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Visual Studio 2017 Brings F# 4.1

| by Pierre-Luc Maheu Follow 1 Followers on Mar 28, 2017. Estimated reading time: 1 minute |

Ready to dig deeper into F# 4.1?

Jonathan Allen provides an in-depth look at these new F# features.

The Visual Studio 2017 release in early March included F# 4.1 and an update of the Visual F# tools. F# 4.1 brings improvements and interoperation with C# 7 while the tools are the first version supporting the Roslyn workspaces.

As previously covered, F# 4.1 brings improvements and interoperation with C# 7:

  • Struct tuples and support for C# value tuples
  • Struct annotations for records and discriminated unions
  • fixed keyword support
  • Underscores in numeric literals
  • Caller info argument attributes
  • Result type
  • Mutually referential types and modules within the same file
  • Byref returns and support for C# 7 ref-returning methods
  • Error message improvements
  • Implement IReadonlyCollection<’T> in list<’T>
  • Additional option module functions
  • Statically resolved type parameter improvements
  • Compiler performance improvements

An updated version of the Visual F# tools also shipped with Visual Studio 2017. A notable addition to the tools is the support of Roslyn Workspace APIs:

A workspace is an active representation of your solution as a collection of projects, each with a collection of documents. A workspace is typically tied to a host environment that is constantly changing as a user types or manipulates properties.

IDEs such as Visual Studio use the Roslyn workspace APIs to provide multiple features. While the compiler part of Roslyn is C#/VB specific, some APIs such as the workspaces sit at a higher level and are not tied to a particular language. Thus, implementing the API means an IDE feature can support F# directly instead of needing a distinct implementation for F#. The features refactored to use Roslyn workspaces include:

  • Find all references
  • Navigation bar support
  • Syntax and type colorization in hovers and signature help
  • IntelliSense filters and glyph improvements
  • Fuzzy matching on names in IntelliSense
  • Better colorization in the editor
  • Code Indentation improvements
  • Breakpoint resolution improvements
  • Go to definition improvements
  • Ability to trigger Lightbulbs for various code fixes
  • Semantic highlighting of tokens
  • Support of Go to All feature (ctrl+T)
  • Roslyn-style inline rename

The official announcement from Microsoft also acknowledges the many contributions of the F# community. Several community members were thanked for their contributions to the F# compiler, Visual F# tools and language design.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT