Monday, May 25, 2009

What's New in Visual F# 2010

F# is a multiparadigm programming language for .NET that is available in Visual Studio 2010. F# supports functional programming, object-oriented programming, and imperative programming.

The following sections describe some of the features available in the first release of Visual F#.

Functions are treated as values, and can be passed directly to other functions. This feature makes it easy to code higher order functions (functions that operate on functions). This makes it easy to write more declarative code, which tends to be less error-prone.

F# supports compositional programming. Functions can be composed and called in sequence using simple operator syntax. Function calls can be chained together using the pipeline operator, which allows the output or return value of one function to be given to another function as input. New functions can also be defined by combining functions together by using the composition operator.

For more information, see Functions (F#).

Lambda Expressions

Lambda expressions allow functions to be defined in place, without having to be named. For more information, see Lambda Expressions: The fun Keyword (F#).

Useful Data Types

Types that support functional programming styles, such as tuples for simple collections of data, discriminated unions for structured symbolic data, and so on. For more information, see Tuples (F#), Discriminated Unions (F#), and Options (F#).

Immutable Data Types

F# provides immutable data structures, such as immutable lists, maps, sets, and sequences. For more information, see Lists (F#) and Sequences (F#).

Pattern Matching

The pattern matching functionality allows you to decompose data into constituent parts and perform complex branching based on the decomposition of data. Pattern matching is also extensible. For more information, see Match Expressions (F#), Patterns (F#), and Active Patterns (F#).

F# supports asynchronous programming, and includes constructs that make this programming easier than ever. For more information, see Asynchronous Workflows (F#). F# also can be used in conjunction with the Parallel Extensions to the .NET Framework. For more information, see Parallel Programming in the .NET Framework.

An F# interpreter, fsi.exe, which compiles and executes code interactively. This allows you to easily prototype your code and try out coding constructs on the fly without the overhead of a compiled project. The interpreter is also integrated with the Visual Studio IDE. For more information, see F# Interpreter (fsi.exe) Reference.

Lazy evaluation, which allows you to delay a calculation until a result is actually needed. For more information, see Lazy Computations (F#).

F# supports object-oriented language features that allow F# programs full access to the .NET Framework, as well as allowing you to producing .NET APIs in F#. For more information, see Classes (F#), Members (F#), and Inheritance (F#).

F# supports imperative code constructs such as mutable variables and arrays, functions with side effects, and looping constructs, for situations where this type of programming is the best way of solving a problem.

Support for mathematical calculations, including operator overloading support, operators that work with generics, a full set of mathematical operators including an exponentiation operator.

F# features support for floating point data with associated units of measure, which allows for unit-checked floating point formulas.

F# also supplies a math library that supports mathematical operations with floating point and rational numbers.

Support for generic programming. For more information, see Generics (F#).

F# is a statically typed language that supports type inference. This means that all program elements have a definite type at compile-time, ensuring type safety, but that you do not have to specify the types of every value explicitly. Because the F# compiler is able to infer the type of program elements in many cases without an explicit type being provided, code is more compact and some types of programming errors associated with type mismatches are reduced. Type inference also includes automatic generalization, which means that functions that can be generic are automatically compiled as generic. For more information, see Type Inference (F#).

A set of libraries that provide support for the core language, collection types, reflection over F# assemblies, and formatted I/O. F# also provides access to the full functionality of .NET Framework 4.0, such as the Parallel Extensions to the .NET Framework, Windows Presentation Foundation, and so on. For more information, see .NET Framework 4 Beta 1.

Source:http://msdn.microsoft.com/en-us/library/c67263se(VS.100).aspx