"you read it first on the Hub"...
A new release candidate of F# is now available! This has a bunch of bug fixes, some minor tool additions, a couple of minor language changes (see below) and, perhaps most importantly, a new installer. Here's the link to the F# release candidate 1.1.11.12, which has just gone up on the external web.
F# Compiler 1.1.11.12
Note: the last step of the installer can take several minutes, if you have Visual Studio. Please be patient. The progress bar does not progress during this time.
Note: if you have trouble installing you can still install using the "alternative-install" scripts. There is also a somewhat rudimentary installation script for Mono (run using "sh install-mono.sh").
Note: there are likely to be a few niggles - please let us know how you get on.
Here are the release notes:
Copy-Local reference options DLLs that are not in the GAC must be copied to an application's directory prioer to execution. This is not currently well-supported by the F# Visual Studio mode. Thus the following options are now supported by the fsc.exe compiler and are especially recommended for use from Visual Studio:
-R DLL both reference the given DLL and copy it to the output directory at the end of compilation
--copy-local FILE copy the given file to the output directory at the end of compilation
Note that -R = -r + --copy-local. Also these switches are not required by fsi.exe which is able to resolve and load DLLs from any location.
New Installer InstallFSharp.msi. This currently always installs to the Program Files directory.
Many minor bug fixes See below
New library module Microsoft.FSharp.MLLib.Native Helpers for native interop. See library documentation.
Minor breaking change for native pointers. The F# "'a nativeptr" is now compiled as the .NET type System.IntPtr for all 'a. .NET pointers such as "int*" are now represented by "ilsigptr" types. This change is because although .NET has a notion of a "pointer type", used in some .NET signatures, these are not "real" types, since they can't be used within generic instantiations. This is very bad for C-interop F# code, which generates generic instantiations when these values are used as part of function and tuple values. Thus, the F# 'a nativeptr type is now always compiled as System.IntPtr, regardless of 'a (these are distinct types as far as F# type checking is concerened - this is just how the type is compiled). The pseudo-type 'a ilsigptr (IL Signature Pointer) is provided if you need to call a .NET signature that is described using a pointer type.
COMPILED and INTERACTIVE supported as standard --define settings in F# Interactive and compiled code This is useful as some code fragments such as Application.Run() are only needed in compiled code. Also accessing things such as resources can vary between interactive and compiled code.
Type Inference corrections for fields and records
Record constructions now use contextual left-to-right type information to help determine the type being constructed. This makes it easier to use record syntax when record member names overlap.
Types are no longer inferred from uses of class field labels alone. Previously, defining a class "C" with a value field called, say "f" meant that "f" became a scoped record label. This meant that "expr.f" would infer the type of "expr" to be "C". This is still done for _record_ labels, but is no longer done for class field labels, and instead an annotation may be needed to constrain the type of "expr" based on left-to-right type inference. A helpful warning about the deprecation of this language feature is given when this occurs. This was always meant to be the intended treatment of inference for these constructs - it was an artefact of the initial implementation that inference for record field labels was treated in this way.
Various .NET generic constraints implemented .NET generics supports a number of somewhat adhoc constraints on the structural properties of types. It is necessary for F# to support these in order to emit correct and valid generic code and make sound use of F# libraries. The syntax of the constraints is:
when 'a : struct // any struct, with the exception of Nullable
when 'a : not struct // any reference type - note - this syntax is under revision
when 'a : new() // default constructor
The following F#-specific constraint has also been added:
when 'a : null // any reference type that supports null according to the F# pseudo-enforcement rules for prohibiting the use of null with F# types
when default 'a = <type> // the variable will take the given value if not otherwise instantiated or generalized
Default constructors are called using the syntax:
new 'a()
Where 'a should be related to another annotation in the same definition, e.g. an argument of the enclosing function. This constructs is compiled as a call to System.Activator.CreateInstance<'a>().
Minor improvements and Bug Fixes
573 F# Compiler list equality is not tail recursive.
613 F# Library List.combine and List.split are not tail recursive (reported by Ralf Herbrich - thanks Ralf!)
615 F# Interactive FSI reflection code throws TypeLoad error for type reference within the same interaction.
602 F# Compiler name of type not reported in "member required" error
120 F# Compiler Things stored in public static fields should only be accessible via properties
495 F# Compiler SQL cannot load F# assemblies due to publically writable statics
625 F# Compiler Poor error location for error messages related to 'new' in signatures
626 F# Library Add 'generate' methods to IEnumerable.
628 F# Compiler nested ifdefs not always handled correctly (Reported by Jack Palevich - thanks Jack!)
630 F# Compiler Error writing assembly with F# 1.1.11.7 (reported by Lewis Bruck - thanks Lewis!)
631 F# Compiler System.MethodAccessException thrown by FSI.EXE (reported by Pierre Dangauthier - thanks Pierre!)
634 F# Compiler object expression limitations: let bound object expressions not generalized (reported by Greg Neverov - thanks Greg!)
640 F# Compiler record fields should be inferred from the known context type of the expression
639 F# Compiler class fields are contributing to the record field environemnt
638 F# Compiler multiple constraints on type parameters not being correctly printed
636 F# Compiler simple object expressions implementing interfaces should be allowed in "let rec" without generating an iniitalization graph warning
632 F# Debug smoother debugging needed for inner recursive functions
648 F# Library Documentation for printf codes for 64-bit integers is incorrect (reported by Richard Mortier - thanks Richard!)
650 F# Compiler incorrectly permitting the declaration of interfaces that contain fields (reported by Robert Pickering - thanks Robert!)
649 F# Compiler bug in quotation template filling for typed quotations (Reported by Tomas Petricek - thanks Tomas!)
646 F# Compiler attributes on top level values not propagating to generated static fields, e.g. ThreadStatic (reported by Robert Pickering - thanks Robert!)
645 F# Debug setting breakpoints in inner functions sort of broken (reported by Jack Palevich - thanks Jack!)
Don for the F# team at MSR Cambridge