Introduction To Preview Release of F# 3.1

Introduction

Microsoft has released the new 3.1 version of F# in the Visual Studio 2013. This is a preview release of F#. F# is an open source language and it is also available for cross-platform. Microsoft introduced F# tooling, language design and compiler implementation in it.

There are two versions that exists before this new version. F# 1.1 focuses on Asynchronous Programming, F# 2.0 focuses on unit of measure, F# 3.0 focuses on type providers and this new version has the ability to improve the software engineering by some improvements in it.

In this article I am describing some new characteristics in this new version as in the following:

  • Fields in union type 
  • array slicing
  • LINQ methods
  • Support for .NET 4.5

Fields in Union type

This new feature helps to create a program in which the shaped data is simple and accurate. In this figure you can see that now it is possible to have a union field within each case of a union type.

Union Case

array slicing

This new feature uses individual indexes to slice columns and rows. In previous versions, the slicing was restricted and we could not slice a shape if two shapes have the same dimension.

LINQ methods

The type inference has some new enhancements in this version. The enhancements are, for example, we can use method overloading in which a function takes arguments. LINQ method overloading is also improved.

Support for .NET 4.5

The F# compiler now consumes the assemblies that are built for .NET 4.5 and Windows Store. You can have the .NET 4.5 + Windows Store by choosing the F# Portable Library template. We can also use it in other platforms like iOS and Andriod.

F# Tooling

  • F# Runtime

    The F# project nows allows you to select the F# runtime version that targets your project.

    F# Runtime Options

    You can take this by viewing the following image also:

    F# Version
     
  • Advantage of Online Templates

    We can also take advantage of online templates for F#. Microsoft added a link for choosing the online templates.

    Create New Project
     
  • Brace Completion

    The auto brace completion is possible now in this version to make the development faster.

    Auto Brace Complete

    You can take advantage of Smart Indentation. Have a look:

    F# TextEditor Options
     
  • Viewing Operator Go To Definition

    You can also see the Tool tip and Go To definition available for operators.

    F# ToolTip

          GoTo Definition for Operator

Summary

This article will help you to learn the F# 3.1 version characteristics and advanced F# 3.1 tooling. You can also get the benefits of general improvements in .NET 4.5 and Visual Studio 2013 RC for F#.