I’m pleased to announce that the first candidate release of F# 1.1 is now available from the Microsoft Research downloads page. This is build 188.8.131.52. We hope you enjoy it! A big thanks to James, who has been working very hard on this, and also Stephen, Dominic and Paul who have helped with the design of the object extensions. Here’s a quick summary of what’s new in version 1.1:
The F# Object and Encapsulation Extensions. F# types can now be augmented with properties, members and operators. Furthermore, classes and interface types may also be defined in F# itself. Object expressions continue to allow a great reduction in the number of classes you need to write in your code.
A preliminary release of ‘F# Interactive’, a top-level command-line interactive environment for F#. The top-level environment will be fsi.exe. This is work in progress, but I’m already finding myself using it all the time!! You can define types, classes, interfaces, functions and values on the fly, create WindowsForms widgets interactively, use the Experimental.Reflection library to explore F# term-structured data, dynamically load DLLs such as Managed DirectX, Avalon or Abstract IL.
Big integers and arbitrary sized rational arithmetic. The types under Microsoft.FSharp.Math.* are implementations of arbitrary precision integer and rational arithmetic types. A partially-OCaml-compatible version of this functionality is included in MLLib, i.e. use the functionality available via ‘open Num’. The types support overloaded operators. The naturals are used to build arbitrary sized integers and rationals.
A preliminary release of XMLDoc support for F#. Standard XML doc files are produced simply by annotating your functions with “///” annotations. The documentation on F# functions is also visible as you view the functions using Intellisense with F# for Visual Studio.
Explicit Type Parameters and Generic Recursion. Functions and members can be added with annotations that explicitly indicate if the function should be generic, that is polymorphic in or more type variables. This is very rarely required in F# code, since type inference normally infers a most-general type for a function, but is useful for some object-oriented programming and some corner cases in functional programming.
The F# Informal Language Specification (Preliminary). A work-in-progress informal language specification is now included in the manual.
Managed and Unmanaged Resource Linking. The command-line flags –resource, –link-resource and –win32res are now supported by the F# compiler for embedding native and managed resources (text files, icons, bitmaps, audio files etc.) into executables. They have the same meanings as the corresponding C# flags.
Additions to Microsoft.FSharp.Idioms. Events and further iteration and folding constructs
Improved responsiveness from ‘F# for Visual Studio’. A significant lock-contention bug has been fixed which makes the Visual Studio mode even slicker, especially on very large files.
Customizable Debugger Views for F# Types. F# types can now be augmented in a a number of ways to customize how the values appear in a debugger. Firstly, the ToString member may be adjusted for each F# concrete type (i.e. record, discriminated union and object types). Secondly, the .NET 2.0 standard DebuggerDisplay attribute can be used in conjunction with member augmentations to customize the simple textual display associated with a type.
Library additions: Printf.failwithf and more. The Printf module now supports the failwithf function, which uses structured formatting to print to a string and then raise a Failure exception for this string. The new printer bsprintf is also supported: this prints to a string but intermediary functions print to string buffers. More general compositional forms of Printf operators are also included that let you specify a ‘final action’ for the printig such as flushing or raising an exception.