Monday, October 19, 2009 8:21 PM
by
RickM
F# Discoveries This Week 10/19/2009
This week the release of Visual Studio Beta 2 and the F# October CTP comes with the wonderful news that FSharp.Core.dll’s interface has been stabilized. In addition, there have been a number of great posts this past week. Come inside and read about Ajax generation, duck typing, composting events and Silverlight MVVM.
Related Posts by Don Syme:
At the source level, we are now aiming for no more changes to FSharp.Core.dll before the Visual Studio 2010 RTM release, apart from removing deprecated functionality. Existing F# users should pay careful attention to deprecation warnings since we will be removing deprecated functionality with the version of F# that will come with the Visual Studio 2010 RTM release.
This is huge news. Code samples written from here on out should be mostly safe from breaking changes. Of course, there are a number of other changes too, many helping compatibility with other Microsoft technologies.
I will demonstrate some of the F# Web Tools features using an "Ajax" dictionary application (see screenshot on the right side) which displays possible matching words as you type the word you want to find. This is one of the typical "Ajax" tasks, so it's a good example to start with.
These tools look very promising for both writing javascript in a type safe way and helping to make client-server interactions easier to manage.
In the latest F# release (May 2009 CTP), the dynamic lookup operator "?" was introduced. I expected people would play with it, but it seems like it went nearly unnoticed. This blog post describes a few ways to use it, it's mostly for fun.
This looks very useful for reflection. However, I do share the same worries of many others in that F#’s type system is a big part of what makes it so powerful. If not managed properly, duck typing leaves you open to unexpected exceptions and code execution.
Many MVVM implementations are available on the net, personally I love the approach used by Laurent Bugnion in the MVVM Light toolkit and Michael Sync in the Silverlight MVVM toolkit. […] All these examples use C#, what about F# for describing ViewModel classes?
I love how concise F# is when compared to the C# examples.
Creating composable events using F# first class events is a pretty compelling story. One of the driving ideas behind the Reactive Framework in terms of composable events does in fact come from F#.
That is some delicious “monadic magic”.