Category Archives: F#

A WPF custom control in F#

What F# language and syntax features are required to implement a fundamentally object-oriented WPF custom control?

Also posted in .NET, Software Development, WPF, Windows | Tagged , , , | 2 Comments

Generating and plotting random numbers

An example of generating random numbers in F# and visualising their distribution using the WPF charting control.

Also posted in .NET, Finance, Visual Studio, WPF | Tagged , , , | Leave a comment

Comparing lambdas in C++ and F#

Lambdas in C++ and F#: compare and contrast.

Also posted in Software Development, Visual Studio | Tagged , | Leave a comment

Visualising Black-Scholes option pricing using F# and WPF

Using F# to create simple plots of Black-Scholes option prices and greeks using WPF.

Also posted in .NET, Software Development | Tagged , , | 3 Comments

F# May CTP released

Well, what are you still doing here, get over to Don Syme’s blog and download it…!

Also posted in .NET, Software Development | Tagged | Leave a comment

IL analysis using F#

A description of using F# language features and reflection to enable basic analysis of .NET IL (intermediate language).

Also posted in .NET, Software Development | Tagged , , | 2 Comments

Installing Windows SDK breaks F# Visual Studio integration

Beware! If you install the Windows SDK – perhaps to get access to the interesting looking WPF performance tools – you’ll find that it hoses your F# Visual Studio integration. I found that it causes intellisense tooltips to stop appearing, and the integrated F# interactive to crash Visual Studio. Both of these issues are a [...]

Also posted in Visual Studio | Tagged , , , , | 5 Comments

Verifying dynamically generated IL

It’s safe to assume that when you use the C#, F# or (heaven forfend) VB.NET compilers, the IL generated for you will be correct. But, if you’re using Reflection.Emit to generate code “by hand” in a dynamic method or assembly it can be difficult to identify problems with the IL you emit. In the majority [...]

Also posted in .NET, Software Development | Tagged , , , , , | 2 Comments

Implementing INotifyPropertyChanged with F#

I like F# for a lot of things, but, man, is it a pain to support events. In C# it’s trivial to implement an interface like INotifyPropertyChanged consisting only of an event, but in F# you have to jump through some hoops to map native functions to delegates/events. F# is generally much terser than C# [...]

Posted in F# | Tagged , , | 4 Comments

Visual Studio Toggle Brackets Macro

After using a F# heavily for a while, I often found myself wanting to add brackets (or rather, parentheses) around some text. This is normally when adding a type specification to an argument in order to be able to use dot notation, e.g. going from:

let typeName t = t.Name

which causes “error FS0072: Lookup on object [...]

Also posted in Visual Studio | Tagged , , , , | Leave a comment