Monday, November 30, 2009 11:44 AM
by
RickM
F# Discoveries This Week 11/30/2009
A great deal going on this past week with Chris Smith releasing the source samples for Programming F#, Julien Ortin writing a spelling corrector, Matthew Moloney exploring the Azure worker role, Steve Gilham playing with NDepend and a flurry of Reactive Framework (Rx) posting by Matthew Podwysocki and Steffen Forkmann.
I've gotten a few requests recently for the source code of the examples in Programming F#. I've attached them as a series of F# Script files.
Disclaimer: I tech edited a portion of this book and so may be a bit biased.
Now that that’s out of the way, you should know that this is currently the only book which is up to date with the plethora of F# API and language changes which have occurred over the past few months. That’s not to say that it’s not also fantastic in its own right, because it is.
At the very least giving these code samples a look is well worth your time.
This post is based on Peter Norvig’s How to write a spelling corrector, which is written in Python. His spell-checker ranks word-substitution candidates by their frequency in the language as determined by parsing some sources. He then gives different ways which could help make his algorithm more effective, such as taking the context into account (using n-grams).
Azure now has support for input endpoints on Worker Roles! (Azure Tools Nov 2009) This is awesome as it greatly simplifies building WCF services in the cloud. As per usual, I’ve gone ahead and ported the most important components to F# and I have included a short list of some of the difficulties I had while doing so.
Following up from the earlier post here, looking more in depth at some of the results out of NDepend for my own little code quality project, and in addition to the results noted there.
Lately in my series on the Reactive Extensions, you’ll have noticed I focused quite a bit on the IObservable<T> and IObserver interfaces as well as the extensions methods that are included. There is one thing, however, that might have been missed with the release of the Reactive Extensions is the inclusion of System.Interactive.dll. The idea behind this is to include many of the extension methods that are available to IObservable<T> and port them to work on the IEnumerable<T> interface.
The “Reactive Extensions for .NET (Rx)” comes with lot’s of operators for using IObservable<T>. This code mimics the signature of the default F# sequence combinators and allows to use observables like sequences.
Yesterday I showed how we can map some of the Rx operators to an API which looks more like the F# base classes. Today I wanted to use these mapped operators in a WPF-application written in F#.