F# 1.1.13 detailed release notes

I’m pleased to announce that F# 1.1.13 has been released. The original release announcement is here. You can download this release from research.microsoft.com/fsharp/release.aspx . A summary of the changes in this release is given below (in some cases these updating the changes in the README-fsharp.html from the distribution)

Enjoy!

Don and James

MSR Cambridge

Language Enhancements

Range Comprehensions. e.g. {1 .. 3} gives an IEnumerable<int>

IEnumerable, Array and List Comprehensions. Basic syntax { for ... in ... -> result } for IEnumerables, where -> should be read as 'yield'. Also [ for ... in ... -> result ] and [| for ... in ... -> result |] for array and list comprehensions. See the informal language specification, the Changes section in the README-fsharp.html for full details and examples, and a revised Chapter 2 of the ‘Expert F#’ book will shortly be released with many more details.

Named arguments and post-hoc property-setters, e.g.

     new MenuItem(text="Hello")  
     new Form(Width=300) 

See the Changes section in the README-fsharp.html for full details and examples. This is not yet covered in the informal language specification.

'for' loops over enumerables. E.g. for i in Regex.Matches("all the pretty horses","[a-z][a-z]") do ...done

Easier object construction. In particular, then blocks in constructors may now reference the variables bound prior to the object construction..

C-style syntax for native functions. . See the Changes section in the README-fsharp.html for full details and examples.

Structs and Enums implemented. See the informal language and the samples in prim-types.fs/prim-types.fsi.

override now required when implementing abstract and virtual members. .

member syntax for object expressions. Allows you to move member bindings between type definitions and object expressions without any syntactic adjustments, e.g.

Pattern matching on arrays. Several people have requested this OCaml feature.

Tightening of #light rules. Extra tokens are now inserted based on indentation and column position to ensure that more code conforms to the requirements of #light.

Reliable compiled names for parameters and Custom Attributes on parameters. Both needed for classes process by some meta-programming tools. Here’s an example of the syntax:

type C =

  class

    static member StaticMember ( [<System.Runtime.InteropServices.Out >] p : int byref) = 0

    member x.InstanceMember ( [<System.Runtime.InteropServices.Out >] p : int byref) = 0

  end

A namespace can now contain a module and type of the same name. Greatly simplifies F# library design and implementation. An attribute annotation is required - see the F# library for examples (e.g. math/complex.fs).

Fast 'for' loops for Range Comprehensions. Constructs of the form for i in n .. m do ... done are optimized as expected.

Library Enhancements

Seq as shorthand for IEnumerable. One of my friends said 'I fall asleep reading IEnumerable'. So we've introduced the type abbreviation 'a seq = IEnumerable<'a> and the module Seq. The latter is identical to IEnumerable except that you can write Seq.empty instead of IEnumerable.empty() . In the long term we may deprecate the module IEnumerable, but it is not yet marked deprecated.

Extensive design review of F# namespaces. The mapping of F# modules to .NET namespaces and module names has been revised. We've gone to great pains to ensure that almost no F# code will actually break because of this change. Top level namespaces:

         fslib.dll: 
             Microsoft.FSharp.Core     
             Microsoft.FSharp.Collections
             Microsoft.FSharp.Compatibility
             Microsoft.FSharp.Control
             Microsoft.FSharp.Math
             Microsoft.FSharp.NativeInterop
             Microsoft.FSharp.Quotations
             Microsoft.FSharp.Reflection
             Microsoft.FSharp.Text
             Microsoft.FSharp.Experimental
 
             Microsoft.FSharp.Tools.FsLex 
             Microsoft.FSharp.Tools.FsYacc
 
         mllib.dll: 
 
             Microsoft.FSharp.Compatibility.OCaml  

Opened by default:

 
         Microsoft.FSharp.Core     
         Microsoft.FSharp.Core.Operators
         Microsoft.FSharp.Core.LanguagePrimitives
         Microsoft.FSharp.Collections
         Microsoft.FSharp.Control
         Microsoft.FSharp.Text
 
         Microsoft.FSharp.Compatibility.OCaml  

 

New library functions. truncate and pairwise added to IEnumerable/Seq, pairwise added to IEvent.

Optional Safer Collections. Collection types that optionally carry tags that track information about the comparison and hashing functions involved.

New Library Module ResizeArray. This module is the F# name for System.Collections.Generic.List.

NativeInterop changes Based on user feedback and a design review, NativeArray.Create is now called NativeArray.FromPtr, NativeTranspose members have been added on CMatrix and FortranMatrix and new types PinnedArray and PinnedArray2 have been added.

UnverifiableAttribute. This attribute can be used to mark code that is potentially unverifiable.

Library addition: Matrix.copy, Vector.copy, Array2.copy.

Library addition: F# Immutable Map values now support the map.[i] syntax.

Library addition: F# Map, Set and HashSet now support IEnumerable

Microsoft.FSharp.Idioms now largely deprecated. Pretty much all the useful operations from this module are now in Microsoft.FSharp.Core.Operators, which is opened by default, or there are other reasonable choices, e.g. just use using instead of Idioms.using.

Simpler OCaml-compatible Channel abstraction. This leads to more generally usable printf and fprintf functions.

F#-specific functions and operator definitions now in Microsoft.FSharp.Core.Operators. Rather than Pervasives.

Collections.HashTable renamed to Collections.HashMultiMap and old name deprecated. This is because the type may bind keys to multiple values, which is not the expected behaviour of a hash table on .NET. We’ve renamed this and deprecated the old name to allow us to use the name as a synonym for .NET dictionaries in the future.

Cleanup of Parser and Lexer engine APIs. Old API functions deprecated. The two namespaces under Microsoft.FSharp.Tools contain the official F# APIs for using the parsing and lexing tools. The OCaml-compatible Lexing andd Parsing modules may still be used.

Removal of some long-deprecated library functions. Idioms.foreachG, List.transform etc.

F# Interactive Enhancements

F# console now implements TAB completion and history. Simple enough, but you should really be using Visual Studio intead ;-)

Visual Studio Enhancements

Visual Studio: Goto defintition now works across projects and into the F# library.

Improved speed of bracket matching in Visual Studio mode. .

Resources in projects: .resx resources may now be added to the list of files in the Visual Studio mode.

Compiler Enhancements

Compiled names for modules now include a "Module" suffix if a RenamedModule attribute is given. Whenever you define a public module in F# code with this attribute, the compiled name of that module now has a "Module" suffix added. This is never visible from F# code unless you use reflection. This allows F# namespaces to contain a module and type of the same name, e.g. a module called List and a type called List. The rules of the F# language disambiguate between these automatically without the Module prefix ever being visible.

Remove renaming of F# library from static linking process. The --standalone flag used to rename Microsoft.FSharp to FSharp, for no particularly good reason. This has been stopped.

Resources on the command line.resx resources may now be added to the F# command-line compiler and as files in the Visual Studio mode.

New switch --generate-filter-blocks. Allows first-chance exception catching for non-matching exceptions.

Samples

New LAPACK sample. . See samples\fsharp\math\LAPACK

Bug Fixes

 752     F# Compiler     object model members have lost their argument names
 751     F# Compiler     type variable names and numbers are all messed up they are the inference type variable names) 
 724     F# Language     permit accurate names on arguments, especially for OO code (reported by Robert Pickering - thanks Robert!) 
 715     F# Compiler     RunClassConstructor XNA on xbox 360
 748     F# Compiler     unicode chars not supported with FSI
 652     F# Samples      Samples101 does not compile resources
 719     F# Compiler     type checking reproted to differ with fscp10.exe
 706     F# Compiler     custom attributes for fields
 754     F# Compiler     support "out" parameter attributes
 756     F# Language     permit attributes on parameters
 765     F# Compiler     System.Runtime.InteropServices.Out on argument parameters does not generate an out parameter
 737     F# Compiler     nested constructs (constants) lead to huge memory and time requirements
 464     F# Compiler     lists, arrays, format strings not reporting error at right location
 658     F# Compiler     Are we checking generalization conditions when implementing abstract or virtual generic methods (making type variables rigid is not enough! Must check we can generalize) 
 488     F# Compiler     "interface method unimplemented" errors (checked at end of scope) give a range that extends over the entire file
 725     F# Library      stabilize LanguageServices API
 767     F# Library      Map type missing a get_Item property for .[] notation
 766     F# Library      Map module still missing to_list, of_list, to_IEnumerable etc. 
 774     F# Language     #light permitting several obviously incorrectly formatted expression forms
 771     F# VS Mode      Cant right click and go to definition through to F# library
 759     F# Documentation        spec and examples needed for high precedence application
 508     F# VS Mode      Visual Studio mode does not report missing files and allows "builds" when files don't exist
 661     F# VS Mode      GoTo Definition doesn't work for F# library definitions
 772     F# Language     pattern matching on arrays requested
 770     F# VS Mode      we're not showing XML help for .NET enumeration values
 662     F# Language     Support comprehensions
 763     F# VS Mode      Can't right click go to defenition
 776     F# Compiler     uppercase member warning
 778     F# Compiler     F# does not support C#-style \x1F characters
 782     F# Interactive  lexer errors upset F# Interactive line error reporting
 781     F# Compiler     use of "+" with "string" types doesn't detect that only reasonable return type is "string" 
 780     F# Compiler     reasonable indentation of a "with" record update gives a #light syntax error
 779     F# Compiler     try/finally on a single line gives a #light error
 760     F# Compiler     #light problems reported by Mort
 762     F# VS Mode      F# VS mode pauses when scrolling pass a bracket-matching character
 736     F# Interactive  AutoExpand is missing (except in the Visual Studio PlugIn version where it is mapped to TAB) 
 798     F# VS Mode      WINEXE option not available in Visual Studo
 799     F# VS Mode      properties box looks kind of messed up in Visual Studio
 800     F# Compiler     F# exceptions should be filtering rather than catching and rethrowing (Reported by rjblack - thanks Richard!) 
 720     F# Tools        fslex doesn't support \xHH
 819     F# Language     support __SOURCE_DIRECTORY__ 
 820     F# Library      support more instances of overloaded multiplication operator on Matrix, Vector and RowVector
 821     F# Library      Floating point numbers such as 1.000000000001 get printed by auto-formatting as just "1" 
 822     F# Library      Redesign the NativeInterop module based on feedback from users and recent LAPACK work
 823     F# Library      Add String.for_all and String.exists
 827     F# Samples      Add LAPACK sample to distribution
 828     F# VS Mode      Double check bracket matching is still working in Visual Studio mode
 777     F# Compiler     lowercase static member gives an error
 815     F# VS Mode      Type parameter constraint errors given against wrong file
 812     F# Compiler     Red squiggly sprinkled randomly like confetti
 806     F# Compiler     #light;; is not an interaction in fsi
 818     F# Language     static property is interpretted as a method
 802     F# Library      Revamp the module locations of the F# Library
 833     F# Language     some long name lookups of constructors and fields not being handled correctly
 835     F# Library      set and map values with different comparison functions are too easy to confuse
 809     F# VS Mode      Installer fails on VS2003 machine - reported by Jan Sacha
 837     F# VS Mode      another unicode bug using VFSI
 836     F# Compiler     Jon Harrop's for-loop-in-constructor bug
 795     F# VS Mode      intellisense not working in #light code
 803     F# Language     cannot write a comprehension binding continaining "let" on a single line in the hardwhite syntax
 692 18/09/2006      F# Compiler     FSI fails when creating delegate type
 694 19/09/2006      F# Interactive  delegate invoke (wrong arity?) falls over in FSI
 709 20/09/2006      F# Compiler     hash on arrays do not detect numberRemaining=0, stack-overflow on circular datastructures
 712 25/09/2006      F# Compiler     :? error with value types in expr
 710 29/09/2006      F# Compiler     offside1, offside2 etc. 
 703 29/09/2006      F# Library      hashtable add throwing stack overflow exception
 708 30/09/2006      F# Compiler     #light interactive bug from Rob
 704 30/09/2006      F# Compiler     fsi --full-help generates same output as fsc --full-help
 716 30/09/2006      F# Visual Studio Intellisense does not work inside ill-formed lists (thanks to Ralf Herbrich) 
 723 30/09/2006      F# Compiler     offside problem (reported by Dennis Hamilton - thanks Dennis!) 
 728 30/09/2006      F# Library      UInt64.to_float and UInt32.to_float sometimes return incorrect results (reported by Dave Wecker - thanks Dave!) 
 729 30/09/2006      F# Compiler     --help and --full-help not showing anything for fsc.exe
 738 02/10/2006      F# Library      Hashing big integers raises an exception