This week we once again reap another huge crop of fantastic F# content.  In fact, it’s been getting so overwhelming that I’ll be moving to an every week format from here on out.  Please come in, read, and enjoy! 

 

News

A New F# Case Study on Microsoft.com

With its new tools, the bank can speed development by 50 percent or more, improve quality, and reduce costs.

 

Next F# London Meetup Announced: July 28th

The next meetup of the F#unctional London Meetup Group will be held on July 28, with Zach Bray talking on Agile Acceptance Testing with F#

 

Tim Anderson (of The Register) Interviews Don Syme

I met Syme at the QCon conference in London, in March 2010, and interviewed him shortly afterwards. Some quotes from that interviewed have already been published in an article for The Register, but I am now posting nearly all of it here.

 

DotNetKicks Now has a F# Section

Thanks to everyone on twitter who voted!

 

Quantifa 0.0.2 Released

Quantifa is an F# open-source library for quantitative finance and risk management.

 

F#-mode for Emacs updated to 0.3

The F# mode for Emacs is two years old, and has been downloaded more than 1,000 times.

 

Tables: Organize Your Files. Written in F#

Tabbles is a new way of organizing files: it combines virtual folders and tags, and auto-organizes and tags your files in very intelligent ways.

 

 

Audio / Video

Svea Ekonomi on F# for automated billing system for the Telecom industry

In earlier versions of the billing system, much of the business logic resided in SQL Server and various Perl and Java programs. That made the solution hard to maintain and tailor to the needs of the customers. By using F# instead of an object oriented language the developers at Svea Ekonomi can be a lot more productive.

 

 

Articles

 

Ian Voyce’s Minilight renderer in F#

I’m a sucker for eye-candy, and the other day I came across the beautifully lit renders produced by Minilight. It’s a nice, minimal implementation of a global illumination renderer that’s been ported to a wide variety of different languages from C to ActionScript. So of course, I couldn’t resist trying to implement it in F#.

 

Jon Harrop’s F# vs Mathematica: fast pricer for American options

Another example from Sal Mangano's Mathematica Cookbook, this time taken from Andreas Lauschke's example, is a "fast" pricer for American options. The relevant section of the book stresses the importance of performance in this context and the Mathematica code presented was heavily optimized by experts.

 

Jon Harrop’s F# vs Mathematica: parametric plots

Another example from Sal Mangano's Mathematica Cookbook (p.520) is an elegant little Mathematica program that uses a crude numerical integrator to plot the trajectory of a differential equation representing the populations of predators (foxes) and prey (rabbits):

 

Jon Harrop’s F# vs Mathematica: red-black trees

The simpler F# solution is also 20× faster at inserting 100k elements and 100× faster at computing the range of depths in the resulting tree.

 

Jon Harrop’s Lorenz Attractor

The Lorenz attractor is a fractal derived from the trajectory of a 3-dimensional dynamical system that exhibits chaotic flow. This blog post describes a 35-line program that computes trajectories of this attractor and visualizes them as a beautiful whisp using Windows Presentation Foundation.

 

Neil Carrier’s Composable Order Relations

Even before I started experimenting, I realized that checking a list for sorting was just a specific example of checking whether the pairs in a list satisfied a certain binary order relation. So I decided to work directly on a more general solution.

 

Neil Carrier’s Continuation-Passing Mnemonics

Learning to construct continuations can be tough. It’s easy to state how they work: they facilitate tail recursion by recursively passing the remainder of a computation. But it can be a lot harder to actually get one working from scratch.

 

Neil Carrier’s Dijkstra’s Shunting-Yard Algorithm

Without further ado, here is my first F# implementation of Dijkstra’s shunting-yard algorithm, including a basic test (based on the example at Wikipedia). This is probably not a minimal or most-efficient implementation, but it is a starting place.

 

Neil Carrier’s Arity and Unit Arguments in F# 2.0

While working on an internal domain-specific language, I encountered a case where passing a unit into a function made the syntax somewhat more readable. The completely artificial example below illustrates the concept as the function xfer1. I also tried a two-unit version, which is illustrated as xfer2.

 

Daniel Mohl’s Presentation: 5 Best Practices for F# Development slides and examples

Thanks to all who come out to the New England F# User Group meeting tonight!

 

Tomas Petricek’s Dynamic in F#: Reading data from SQL database

If you ever tried to call a SQL stored procedure directly using the SqlCommand, then you can surely appreciate the elegance of this code snippet. Let's now take a look at a larger example and some of the neat tricks that make this possible...

 

Erik Schulz’s Cartesian Tree Sort – Revisited, Cartesian Tree Sort – Skew Heap and Beating Quick Sort - Cartesian Tree Merge

After looking at skew heap, merge sort and Cartesian tree, I figured there has to be a way to combine all three.

 

Julien Ortin’s SEO Analysis in F#, and SEO Analysis in F#, a friendly application

Last time, we created a library of Search Engine Optimization (SEO) helpers. This time we’ll see how to use them to actually fetch information about your webiste rankings (and your competitors’).

 

Julien Ortin’s European Central Bank – extracting reference rates with F#

Every day, the European Central Bank publishes “official” reference FX (foreign exchange) rates where currencies are quoted against the Euro (expressed as EUR/XXX), or 1 EUR = xxx XXX. The exchange rates of the last thirty sessions are available in xml format which we shall try to parse.  In order to do so, we use F# and active patterns, based on Don Syme’s draft paper.

 

Anton Tayanovskyy’s Optimizing JavaScript with F#

The need for optimizing JavaScript is very peculiar. This is not about delivering top wall-clock performance, but rather delivering the most compact (in Release mode) and most readable (in Debug mode) source. In the case of WebSharper™, it is also about relieving the compiler and the macro writer from the burden of emitting optimal code.

 

Chris Ballard’s My First F# Post

That said, this post will take you through my solution for Euler 54, which (somewhat unusually) isn't a particularly mathematical problem, but turns out to be a great way to demonstrate some of the features of the F# language. The basic principle of this problem is to compare two hands of cards in the game of poker, and to determine which is the winning hand.

 

Chris Ballard’s Prime Numbers - Building the EulerMaths library in F#

Those of you who are doing Project Euler know what I am talking about by the EulerMaths library. There are certain fundamentals which crop up again and again in the questions and it is important to work these into a reusable and performant library.

 

Daniel Mohl’s WPF MVVM Multi-Project Template: A Polyglot Approach

As an advocate for using the right tool for the job, I have created a new WPF MVVM multi-project template composed of an C# View project, an F# ViewModel project, and an F# Model project. 

 

Rodolfo Ortega’s Eliza like chat bot in F# language for fun

This is a very simple Eliza like chat bot. I call it Meliza Sharp. I wrote it for having fun learning the F# language shipped with Visual Studio 2010.

 

Mauricio Scheffer’s Abusing PrintfFormat in F#

Pretty cool, huh? This trick can be used for other things, since PrintfFormatProc is fully reusable. For example, I'm currently using PrintfFormat manipulation to define type-safe routing in a web application

 

Mark Pearl’s Depressingly simple text file access

Today I was doing some work work and kept having to parse a log file. After a few hours of doing the same routine stuff I thought I might try and automate it using F#.

 

Mathias’s On the road from C# to F#: reading stock quotes and more stocks

Mads Kristensen has a nice post where he shows how to read  stock quotes from Yahoo finance using C#, which was very helpful to get started. I figured it would be interesting to try out a conversion to F# and see what the result looked like.