Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the recent changes to F#?

Tags:

I am starting to learn F#. I am well versed programming languages like C# (and using the .NET framework in general), but functional programming is new to me. The way I learn best is by taking a book about the subject and starting to read - so I grabbed a copy of "Expert F#" and "F# for scientists". A few times I got the impression that those books seems already to be outdated due to recent changes in the language - nothing too dramatic, but it gives a bit of a nagging feeling that there may be more.

Now that F# 2.0 seems to have stabilized, it would be nice to see how the 'real' F# has turned out compared to the versions of the language described in those (and similar) books.

So my questions are:

  • what topics have changed since the books were printed, and are no longer valid as described? Are ther any chapters I can skip completely? (I am aware that some functionality has been moved to the the PowerPack, though it is not totally clear to me which functionality is in the PowerPack, and which is in the standard install)
  • what features of the language are described correctly, but have newer alternatives available? (Is the description of events still up to date?)
  • which features of the language I should be aware of that were added (or modified) since those books were written?
  • are there other recent changes in the language that I should be aware of?

edit: Thanks all for the answers!

As far as release notes go, I was able to dig up the following "detailed release notes" posts on Don Syme's blog, applying to versions of F# after 1.9.2 (the version "Expert F#" mentions as being the version used in the book):

  • Versions 1.9.3.7 and 1.9.3.14
  • Version 1.9.4 and 1.9.4.19
  • Version 1.9.6 (September 2008 CTP)
  • May 2009 CTP ("Beta 1")
  • October 2009 ("Beta 2")
  • 2.0 RC (February 2010)

I didn't find anything about version 1.9.5 - did that one ever exist?

like image 688
Luc C Avatar asked Feb 11 '10 20:02

Luc C


People also ask

What are the F1 rule changes for 2022?

The 2022 car will have a redesigned front and rear wing and changes to the floor in an attempt to produce more downforce and make the car stick to the track more. Aesthetically, the cars will look much different with an updated rear wing as well as new 18-inch wheels replacing the 13-inch of years gone by.

What are the new changes in F1?

The key changes are: A ground-effect floor. The 2022 car has two long underfloor tunnels which create a 'ground effect' - meaning there is more suction under the car to pull it to the tarmac, while also ensuring more of the downforce is generated from under the car.

Are the 2022 F1 cars faster?

The 2022 Formula One cars were supposed to be three to five seconds slower than the 2021 cars, but it turns out that's not quite the case. The designers have already done a good job this year, as the top has stayed pretty close to last year's times.

Are F1 cars the same as 2022?

Rule changes regarding aerodynamics mean this year's F1 cars look quite different from their 2021 predecessors. Some drivers have also switched cockpits.


2 Answers

I probably can't give a complete answer, but here are some things that come to mind as having undergone non-trivial changes in the past two years I've been working on F#...

Minor changes:

  • Many library functions have been renamed. There originally was a penchant for underscores that has since been removed to be more .Net-like. So e.g. Seq.to_array is now Seq.toArray. Some significant changes to async and quotations APIs too.
  • #light is now the default, you can quit putting it at the top of every file
  • some changes to the APIs/declarations of events and enums (the language reference and library docs on MSDN are good for up-to-date information)
  • no more need for [<OverloadID>] to make overloaded member functions

New features:

  • Units of measure was new in Beta1.
  • comparison and equality constraints were new in Beta2.
  • unmanaged constraint in RC.
  • (check out the "release notes" for various releases, linked in prior bullets, for more)
like image 106
Brian Avatar answered Oct 20 '22 19:10

Brian


I'm doing a windiff of the lastest(1.9.9.9) and previous(1.9.7.8) release of FSharp.

I noticed many added calls to checkNonNull in Array, Seq, Reflect and the Quotation module. I assume these calls were added to protect F# libs from being passed nulls from another language such as C#. Any insight Brian? The function nullArg throws an ArgumentNullException.

let inline checkNonNull argName arg = 
    match box arg with 
    | null -> nullArg argName 
    | _ -> ()
  • There is a new override ToString in set and improved formatting for set and map printing with sformat aka printf "%A".
  • Some internal cleanup of BigInteger for use with .net 4.0.
  • I see a lot of internal changes to async as Brian mentioned.
  • Some internal changes to Event to use IObserver.

I finished going through all the changed fs files and most of the changes are to private functions that are not exposed directly. The only thing that may effect the user is different pretty printing of sets and maps.

like image 39
gradbot Avatar answered Oct 20 '22 19:10

gradbot