Detailed release notes for 1.1.12.3


Detailed release notes for 1.1.12.3


 


Collected changes between v1.1.11.12 and 1.1.12.3


Lightweight syntax option. Are you sick of writing in? The #light option makes the use of certain keywords such as in optional by using indentation. See the informal language specification for details, as well as the ConcurrentLife sample and the Samples101 tutorial. Enable using #light.


First experimental cut at the Active Patterns. More on Don Syme’s blog.


More modules in MLLib. Modules UInt8, Int8, Int16, UInt16 have been added.


More collections in Microsoft.FSharp.Collections. The Set and Map collections are now defined as object-oriented abstractions in Microsoft.FSharp.Collections. The corresponding MLLib modules are defined in terms of these OO abstractions.


Removed deprecated Stream module from MLLib. Minor updates to the LazyList module as a result.


–gnu-style-errors flag no longer accepts spurious integer argument.


Slight modification to overloading for +,*,/,mod.


In version 1.1.11 a slight change was made to the default overloaded signature for operator to allow the return type to be unassociated to the two input types, as is required for overloading on the System.DateTime subtraction operator. This change was mistakenly applied to other operators, resulting in situations where type inference would report unexpected inference errors for fairly straight-forward floating point code.


Bug fixes.

    —	F# Compiler	-R clobbers DLLs with PDBs
— F# Compiler no properties being generated for top level values
605 F# Visual Studio VFSI scroll to caret does not always show input position
643 F# Compiler internal warning when unpickling override of abstract member
655 F# Compiler interface implementing methods marked private but included in modul_typ
656 F# Compiler Runtime exception TypeLoadException method ‘Specialize’… tried to implicitly override a method with weaker type parameter constraints
645 F# Debug problems setting breakpoints in inner functions (reported by Jack Palevich – thanks Jack!)
647 F# Compiler lowercase constructors are incorrectly permitted
654 F# Interactive cannot declare delegate types interactively
672 F# Visual Studio Unapplied methods should give signature of method overloads in error message
671 F# Compiler -R feature overwrites .dll file with .pdb file
670 F# Compiler protected access not permitted via member ‘this’ variables
668 F# Language L-R type inference with (fun x -> x * x * 1.0)
667 F# Language exceptions to carry line numbers?
663 Fix broken codegen for generalized constrained polymorphic functions
659 F# Visual Studio Intellisense does not work in a for .. to .. do line
676 F# Visual Studio Inappropriate popup
644 F# Language execution and inference for record expressions is not always left-to-right
533 F# Release proper uninstaller
517 F# Compiler fsi.exe does not process #r/#I directives for files on command line
678 F# Library delete very old obsolete functionality fro the ‘Set’ module
679 F# Library Add object-oriented version of immutable ‘Sets’ to Microsoft.FSharp.Collections
681 F# Visual Studio hardwhite intelisense
682 F# Compiler field and property names with same name – allowed
680 F# Visual Studio intelisense bugs
665 F# Language exprs ending in semi-expr sequences cause confusion when ending constructs which are themselves semi separated.

Changes between v1.1.11.7 and 1.1.11.12


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.


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 cange 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 for function and tuple values. Thus, the F# ‘a nativeptr type is now always compiled as System.IntPtr, regardless of ‘a (it is not type equivalent as far as F# is concerend – 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 using a pointer type.


COMPILED and INTERACTIVE supported as standard –define 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

It is implicit in the F# informal specification that record constructions should use contextual left-to-right type information to help determine the type being constructed. This is now implemented, and 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 : unit -> ‘a) // 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!)

Comments (5)

  1. We’re very pleased to announce that F# 1.1.12.3 is available for download.

    This release incorporates…

  2. Ethan says:

    #light looks great!

    As F# continues to grow by leaps and bounds, is there any chance we’ll see a package distribution system ala godi or cpan?

  3. La programaci&amp;oacute;n funcional es uno de los paradigmas de programaci&amp;oacute;n b&amp;aacute;sicos que tiene