Full Release Notes for F# and

I'm glad to say that a release candidate for F# 1.9.3 is now available (download via main post). The changes up to are documented further below. Additional changes between1.9.3.7 and are:

  • Constructed classes may now be mutually recursive with other types, fixing an incompletness in the language implementation

  • Microsoft.FSharp.Core.Func module is deprecated (this containes a few rarely used functions related to values functions themselves)

  • Add prefix operators "%" and "%%" as ASCII-equivalent for Unicode section marker operator used for splicing into quoted expressions (i.e. for data binding into quotation expressions).

  • Some additional identifiers have now been marked with the 'OCaml compatibility' attribute. We recommend people cross compiling with OCaml use --no-warn 62. In the next release this warning will be off for all files ending in extension ".ml".

Language Additions:

· Multiple Custom Value Syntax,

· Access Controls,

· DefaultValue static fields

Library Changes:

· Rename fslib.dll and mllib.dll to FSharp.Core.dll and FSharp.Compatibility.dll,

· Improved Library Documentation (thanks to Ralf Herbrich)

· Add Async.Parallel2, Async.Parallel3, WebRequest.GetResponseAsync

Language Cleanup

· As part of the productization of F# we’re looking at doing a “spring clean” of some of the things we’ve got in the language that we may not want to support in the productized version. As a first step, we’ve added warnings and deprecations to some language constructs.

Performance Improvements

· Some performance improvements to filtering sequence expressions.

Bug Fixes

· A number of bug fixes – see below

Language Additions

Multiple Custom Value Syntax

Multiple custom attributes can now be specified using repeated uses of [< ... >] , as well as via the previous technique where a single [< ... >] is used with semicolon separation.



    let x = 1

Custom Attribute Targets

The custom attribute targets "field:" and "property:" can now be used to distinguish if an atribute on a record field or "val" class field applies to the underlying .NET field or .NET property. This is useful in XML Serialization among other things:


open System.IO;;
open System.Xml.Serialization

type exchangeInfo = class
[<field: XmlAttribute("Code")>]
val mutable exchangeCode: string
[<field: XmlAttribute("ScripCode")>]
val mutable scripCode: string
new() = { exchangeCode = null; scripCode = null }

Access controls

This release includes an early prototype of access controls, a feature that lets you use the keywords internal and private to mark values, members, record fields and union constructors with restricted visibility. For example:

    let internal x = 1

    type MyRecord =

        { private x : int }

        member private obj.TwiceX = obj.x + obj.x

        static member Create(n) = { x = n }

Caveat: a number of checks are not yet implemented. In particular, if you mark a type or a module with private or internal you will get a warning that the checks for these kinds of constructs are not yet complete.

DefaultValueAttribute for static fields

F# now permits classes (including those with implicit constructors) to have uninitialized val fields marked with DefaultValueAttribute. This is primarily for codedom codegen. These fields will be initialized to null or the zero-bit-pattern for structs. These may also be marked static val. As a result we also implemented the setting of static F# fields.

EDITING define in Visual Studio

Add EDITING define to Visual Studio mode: this is ON as far as Visual Studio editing is concerned, but OFF for compilation and execution. This is useful when mimicking generated codedom code in a partially implemented file

Library Changes and Enhancements

Rename F# Libraries

The F# libraries have been renamed: fslib.dll becomes FSharp.Core.dll and mllib.dll becomes FSharp.Compatibility.dll. This renaming has been planned for some time in order to give F# DLLs more standard .NET library names and we believe it will help us to grow the library further as time goes on.

Move some less important collections to FSharp.Compatibility.dll.

Minor Library Additions

Added Permute to vector type, PermuteRows, PermuteColumns to matrix type.

Improved Library Documentation. Thanks to Ralf Herbrich for helping us complete minimal documentation for each funciton in the library.

Add Async.Parallel2 and Async.Parallel3 to Microsoft.FSharp.Control

Add more members to BigInt, Add modulus operator to BigInt.

Add INormFloat for generic distance algorithms.

Add WebRequest.GetResponseAsync to Microsoft.FSharp.Control.CommonExtensions.

Language Cleanup

As part of the productization of F# we’re looking at doing a “spring clean” of some of the things we’ve got in the language that we may not want to support in the productized version. As a first step, we’ve added warnings and deprecations to some language constructs.

If this greatly impacts your work, please let us know

Warning on type augmentations containing override and interface implementations.

Type augmentations separated from a main type definition now give a warning if they contain interface implementations or implementations of overrides (see TypeAugmentations). This is because of the unsoundess mentioned as part of the specification, in particular "Augmentations that define interface implementations and override defaults may result in undefined behaviour if the intervening code creates instances of the object at runtime and makes calls via the virtual dispatch slots implemented by these functions (ill-defined recursion cycles can in principle occur)." This feature may be deprecated in a future release of the language.

Static optimization construct is now "library only"

The "static optimization" language construct now gives a warning it is used outside the implementation of the F# library. Use of this construct requires extreme care and if misused can cause unverifiable to be genreated or lead to the behaviour of code varying under different optimization settings.

Floating point ranges being considered for deprecation

Ranges such as [ 1.1 ... 100.1 ] over floating point numbers are being considered for deprecation, and currently give a warning when used. Floating point ranges specified in this way are inherently highly sensitive and the resulting sequences often end up having a non-intuitive number of elements under any reasonable specification. Instead simply use an integer range and convert to floating point. A future version of F# will incorporate an operator along the lines of "linspace" from Matlab.

Samples and Tools

FxCop: Fix some low hanging fruit so fewer errors are reported

Adjust ConcurrentLife sample so it compiles and runs correctly

Update F# Linq samples to match the Expert F# book and to work with Orcas Beta2

Improved ASP.NET sample help

Add command line option to permit the name of mscorlib.dll to be set. For use with Singularity.

Bugs Fixed

    1007 F# Compiler Improve error message for property member without "this" (was internal compiler error).

    1061 F# Compiler Two property nodes being generated for get/set metadata

    1103 F# Compiler Bad code generation for active patterns from fswebtools example

    1104 F# Compiler *** WARNING: basic block at end of method ends without a leave, branch, return or throw. Adding throw

    1111 F# Compiler fswebtools code doesn't verify

    1112 F# Compiler Cannot define an interface with a generic method

    1116 F# Compiler Active pattern example fails where function is defined by matching (Reported by Andrew Kennedy - thanks Andrew!)

    1117 F# Compiler Bindings that look like function definitions are interpreted as pattern

                           matches without warning. Add a warning for this case to allow for later language

                           design change here.

    1121 F# Compiler Allow attribute targets "module", "type", "assembly", "class", "struct", "interface", "delegate", "property", "field"

    1126 F# Compiler Unverifiable code generated by TLR and other optimizations when used with

                           constrained local generic functions


    1253 F# Compiler Implement optimizations related to 'when' filters in sequence expressions

    1255 F# Compiler Make static optimization construct library-only (give a warning)

    1261 F# Compiler CodeDom bug: FieldTest is failing in codedom suite

    1263 F# Compiler Nested mutable structs not being mutated correctly

    1264 F# Compiler bignum/bigint literals don't meet specification, e.g. f -3N is accepted when it should be f (-3N) like all other integer forms

    1265 F# compiler Deprecate #hardwhite and #white (old names for #light)

    1266 F# Compiler Internal values are being optimized away in cross-module situations

    1271 F# Compiler Internal and Private keywords in 1.9.33

    1272 F# Compiler New-ing a sub class with unimplemented abstract members should not be allowed (reported by Keiko Nakata - thanks Keiko!)


    972 F# Interactive FSI reports "error: forceM: - envGetMethB: failed"

    982 F# Interactive Visual Studio FSI doesn't function correctly on some machines. Force session to be in UTF8.

                           This fixes a codepage related bug that rendered input/output invisible.

    984 F# Interactive --exec doesn't function correctly

    1027 F# Interactive Incorrect parsing of some expressions. Expr interactions were dropping lookahead tokens.

    1053 F# Interactive Bug accessing XLinq op_Explicit method from FSI

    1198 F# Interactive #time ms printing 2d not 3d


    1033 F# Visual Studio Some errors related to DLL references were being swallowed into Visual Studio (reported only once then swallowed into cache).

    1037 F# Visual Studio Adjust "incomplete matches warning" so it underlines less intrusively in visual studio.

    1100 F# Visual Studio Missing DLLs specified in project arguments not reported correctly in Visual Studio error window

    1106 F# Visual Studio VS mode is swallowing some errors that reporting that a DLL can't be found


    1095 F# Samples Ensure FLinq really works under Orcas Beta2

    1267 Samples PersonalWebSite sample is busted (reported by Tomas Petricek)

    1268 Samples F# version number not being added to web.config files in samples


    1118 F# Library Scaling operator missing from matrix class (reported by Martin Szummer - thanks Martin!)

    1017 F# Library Range comprehensions fixes for wraparounds and min/max int conditions. Exact number of steps with floats where possible.

    1051 F# Library Calls to F# members should be quoted as MethodCall and PropertyCall nodes in the quotation tree

    1127 F# Library foldByCol and foldByRow are incorrectly implemented in F# matrix library

    1129 F# Library Add RowVector.zero to the F# matrix library

   1080 F# Library Seq.cache_all does not have the properties of cache. Deprecate Seq.cache_all,

                           add Seq.cache to return a IDisposable handle

    1215 F# Library bigint now has properties which are printed by fsi.


  1052 F# Tools Fix numerous issues with CodeDom code generation: Generate static fields, Remove old hacks

                           for generating static fields, Generate type code snippets,Fix order of

                           compilation of files.