Parallelization in F#

In my last post I was writing about parallelizing loops with Parallel.For in C#. Today I though it would be nice to try that in F#. So, here is the benchmarking of the matrix multiplication and the bubblesort algorithm in F4. Matrices Multiplication I started with a create_matrix function that creates and randomly initializes a … Read more

ParallelFX Saves!

After the MVP Summit in Seattle, I started to dig into the Parallel FX framework (currently under a CTP available here). In just a few words, the framework is composed of: Task Parallel Library (TPL), that provides means to manage task (i.e. units of execution), and exposes a TPL API, represented by the static function … Read more

F# Resources

Here is a list of, what I consider, good F# resources. Hopefully you’ll find them helpful. Official Documentation Official F# page at Microsoft Research F# manual informal F# documentation Forums and Wikis F# wikicontains articles, tips and sample code hubFSa very good forum focused on F# Blogs Don Syme’s Blog: the blog of F#’s creator … Read more

Arrays in F#

Yesterday I wrote about list in F#. Today I’ll write about arrays, which unlike lists are a mutable flat storage and cannot be resized. That means you have to create a new array if you want to remove or add elements. Advantages include constant look-up time and the fact that they can store a large … Read more

F# Projects with Visual Studio 2008

I started a few days ago to study F# and I was struggling with some things that were not good documented. I want to share what I’ve learn from that and hopefully that will help others. After you download and install F# (available at http://research.microsoft.com/fsharp/release.aspx) a new project template will be made available in VS … Read more

Convert.ToInt32 versus TryParse

There are two way of converting strings to numerical values in .NET. The first one, supported since the first version of the platform, is the use of System.Convert class. It has methods like ToInt32, ToChar, ToDouble, ToDataTime, ToDecimal, etc. Here is an example of converting string “123” to numerical value 123. string text = “123”; … Read more

C# ListBox with Variable Height Items

Suppose you need a ListBox that has to display items with the text spread across multiple lines. With the default implementation that would look like this: The CR LF characters are displayed as squares and the item has only one line of text. To make the list box items have variable height depending on the … Read more

F# integrated in Visual Studio

One week ago, Somasegar (Corporate VP for the Microsoft Developer Division) wrote on his blog that Microsoft will integrate F# (a functional language) in Visual Studio. We will be partnering with Don Syme and others in Microsoft Research to fully integrate the F# language into Visual Studio and continue innovating and evolving F#. In my … Read more