Welcome to Atalasoft Community Sign in | Help

One of the greatest things about running this blog, other than having a structured way to read all of the F# community content, is that I’ve been able to watch the community grow in a very concrete way.  Looking back to a year ago there was only six posts on F# over the course of a week, now we have well over twenty.  It’s truly amazing to see.

Now, on to the links.
 

Audio and Video

Dr. Ralf Lämmel's C9 Lectures: Advanced Functional Programming - Type Classes

“In this second lecture in the series, Ralf digs into Type Classes, which are type system constructs that were originally introduced to provide a form of ad hoc polymorphism (i.e., an advanced form of overloading).”

Rick Minerich's Functional Language Paradigms with F#

“I've got great news. F# is here and is poised to increase your productivity and reduce your suffering.”

Peter Sestoft's Teaching programming language concepts with F#

“Peter introduces the curriculum, lecture plan and lecture notes for the course "Programs as data" that uses the functional programming concepts in F# to teach students language concepts and implementation details.”

 

Tools

Essential F# | Refcardz

“This DZone Refcard will lead you through the basic essentials so that you can quickly move on to using this Functional Programming Language for creating some mind-bending code.”

fsxplat - Released: FSharp packages 1.2

“F# packages and samples for use across platforms”

Phillip Trelford's TickSpec: An F# BDD Framework

“Right now TickSpec is intended as a lightweight framework to get you started with BDD using F#. It is standards based, supporting a subset of the Gherkin language, so should be easy to change to another Gherkin based framework like Cucumber, SpecFlow or StorEvil.”

 
 

General

Vladimir Matveev's F#: Building compiler from sources.

“Of course, compiling them sources and observing all internal compiler activities, so to say “in action’.”

Ashley Feniello's Fixing Decades-old Bugs in the HP-35

“To make an assembler, I just parse with a series of regular expressions. F#’s active patterns came in super handy for this! In fact, the assembler turned out to be fewer lines of code than the disassembler.”

Ashley Feniello's Microcode-level HP-35 Emulator (in JavaScript!)

“I had the (silly) idea of building a JavaScript-based emulator. Looking at Peter Monta’s Python-based disassembler and his object code listing, it looked simple enough to automatically generate script from David Cochran’s original bits. I wrote my own little straight forward 100-line disassembler in F#, producting an array of JavaScript functions”

Brian McNamara's F# for puzzles (Morse code decoder)

“The idea is simple; the computer works out all the possibilities for the next 3 letters, and then the human selects which prefixes “look promising” to investigate further.”

Neil Carrier's TechNeilogy: Fuzzy Logic F# Reference Module: Fuzzy0

“Below is the fuzzy logic reference code for module Fuzzy0. Tomorrow I’ll post an example of its use that explores some extensions of earlier techniques.”

Yin Zhu's F# and Data Mining: WekaSharp: Tutorial for using Weka in F#/.Net

“The minimal wrapper in F# for Weka.”

Daniel Markham's Structuring Larger F# Functional Projects

“So here's a suggested structure outline for those larger functional projects”

Ade Miller's F# Samples for Parallel Programming with Microsoft .NET

“We’ve been working with the F# Team to get the samples for Parallel Programming with Microsoft .NET ported to F#.”

Neil Carrier's TechNeilogy: F#, Fuzzy Logic, WPF, and Tomatoes!

“This is my 100th blog post, and to celebrate, I’m pulling out all the stops. This example will combine F#, fuzzy logic, WPF, and tomatoes!”

Neil Carrier's TechNeilogy: Conjunctive Fuzzy Logic Rules in F#

“It shows how to make multipart conjunctive rules by storing the input sets in a list and using the “min” operator to combine the results into a truncation height. To do this, it adds vector versions of the fire and fire all functions.”

Justin Angel's Windows Phone 7 supports VB.Net and F#

“In this article we’ll review Windows Phone 7 support for the Visual Basic .Net and F# programming languages. Our goal is to demonstrate that Windows Phone 7 can indeed support F# and VisualBasic.Net code libraries and user controls.”

F# Artificial Intelligence Library Tutorial

“This step-by-step tutorial describes how to use the library in fsx script and C# project.”

Chris Marinos's 5 Reasons to use F# Interactive in Visual Studio 2010

“I find that I use F# Interactive more for performance analysis, learning F#, and verifying Base Class Library behavior than for spiking or scripting.”

 

Community

Stack Overflow - Calling F# (.Net dll) code from php

“Yes you can, by using PHP COM class but it works only on Windows version of PHP5+ and needs no separate installation.”

Stack Overflow - Scrap Your Boilerplate in f#

“I've used the Scrap Your Boilerplate and Uniplate libraries in the Haskell programming language, and I would find that form of generic programming over discriminated unions to be really useful. Is there an equivalent library in the f# programming language?”

Stack Overflow - Path to Become a Better F# Programmer

“What should be my steps from now on to become a better/professional F# programmer?”

 

 

Teaching and Basics

Bill Morrissey's Learning F# for C# developers: Scope, Workflow and Lists

“This post is part two of a series of posts looking at syntactical examples of F# and C#. This post will supply you with easy to understand F# coding examples.”

Anders Hesselbom's Type inference in F#

“I have recently been to a short F# presentation at HiQ in Arboga. One of the things that got mentioned was type inference.”

Rey Dacoco's WebBrowser control (Visual F# Windows Forms Application)

“WebBrowser control is a control used to display a web page or web document. To create a WebBrowser control in F#, use the following syntax:”

I’m back again with another edition of F# Discoveries this Week.  The most exciting announcement this week is the new F# August 2010 CTP which brings with it the ability to build your own VS2010 F# Express Edition with Visual Studio Shell and the prospect of building F# applications on Windows Phone 7.  Be sure to check out Daniel Mohl’s Windows Phone 7 template before getting started.

 

News and Upcoming Talks

F# (August 2010 CTP)

Announcing the F# 2.0 Standalone Tools Update

A standing invitation to F# users to "get in touch"

Don Syme lecturing at the F#unctional Londoners Meetup (9/9)

 

Tools and Libraries

WekaSharp: An F# wrapper for Weka (Yin Zhu)

F# and C# Win Phone List Template (Silverlight) (Daniel Mohl)

fsai Release FSharp AI library 1.10.0 (Lukáš Kouřil)

RockScroll: my new favourite Visual Studio Add-In (Kean Walmsley)

 

Video, Audio and Slides

Slides and samples from F# talk in Manchester (Oliver Sturm)

F# Intro Talk at NextGenUG in So’ton (Phillip Trelford)

Slides from Combinators, DSLs, HTML, and F# (Robert Pickering)

Busy .NET Developer’s Guide to F#: Basics (Ted Neward)

 

Technical Articles

iTunes via F# Interactive (Cameron Taggart)

F# for puzzles (Morse code decoder) (Brian McNamara)

Extracting elements from Win32 resource files (Luis Diego Fallas)

A variation on Matt Moloney's "Memento" pattern (Don Syme)

Bound Variables in F#: What Reflection Reveals (Neil Carrier)

Getting F# Running on a Continuous Integration Server (Ade Miller)

How F#'s async really works? (George Cullen)

Segment Tree in F# (Neil Carrier)

Bound Variables in F#: What Reflection Reveals (Neil Carrier)

Fuzzy Logic Experiments in F# (Neil Carrier)

Fuzzy Logic in F#, Example 1 (Neil Carrier)

Fuzzy Logic in F#, Now More Functional! (Neil Carrier)

F# “fun” with Windows Phone 7 (Fahad)

Getting started with Windows Phone in F# (Senthil Kumar)

Euler Problem 10 (Mark Pearl)

Euler Problem 16 (Mark Pearl)

Project Euler Problem 9 in F# (Stefano Ricciardi)

Project Euler Problem 8 in F# (Stefano Ricciardi)

Project Euler Problem 6 and 7 in F# (Stefano Ricciardi)

Enumerable.Skip vs Seq.skip (Mauricio Scheffer)

 

Getting Started and Evangelism Articles

Putting the fun in functional programming (Daniel Markham)

Back to school : Getting to know F# (Mehfuz Hossain)

Learning F# by writing C# (Alan Hemmings)

F# - sharper than C# (Josh Reuben)

Learning F# for C# developers (Bill Morrissey)

 

F# Community

Ars Technica - What do you think of F# ?

SO - How to merge sorted sequences in F#.

SO - Which to use, C# or F#? In this "real world" case

hubFS: F# Databse Application Samples & Articles

hubFS: MailboxProcessor.TryScan paradigm

Tons of great links along with a brand new less cluttered format today.  Let me know what you think on twitter.

 

News / Talks

Talbott Crowell at San Fancisco Bay Area F# Users Group (8/16)

Don Syme at the Community for F# Online (8/17)

Luke Hoban will be giving a F# keynote at CUFP (10/2)

Joel Pobar "Smart Software with F#" at JAOO (10/6)

 

 

Podcasts / Screencasts / Videos

Perspectives on Clojure and F# (with Rich Hickey and Joe Pamer) (Joey deVilla)

Advanced Functional Programming - The Expression Problem (Dr. Ralf Lämmel)

The Language Matters on the Software Engineering Productivity Podcast (Rick Minerich)

 

 

Articles

Undo / Redo using the Memento Pattern and Command Pattern in F# (Matt Moloney)

A variation on Matt Moloney's Undo/Redo "Memento" pattern (Don Syme)

Hindley Milner Type Inference Sample Implementation (Edmondo Pentangelo)

INotifyPropertyChanged strikes back (Vladimir Matveev)

WebSharper, part 2: WebExcel (Vladimir Matveev)

OOP Virtualization vs. F# Discriminated Unions (Neil Carrier)

Segment Tree in F# (Neil Carrier)

A F# Silverlight Template (Daniel Mohl)

Reading F# Projects, Part I: The Common Knowledge (Yin Zhu)

Reading F# Projects, Part II: F# Set (Yin Zhu)

Reading F# Projects, Part III: The F# math providers. (Yin Zhu)

Query Zune Music Collection with F# (Cameron Taggart)

How to merge sorted sequences in F# - Stack Overflow (Neil Carrier)

Combining memoization and tail-recursion – Stack Overflow (Ronald Wildenberg)

"I think F# is very cool" - Rich Hickey (Flying Frog Consultancy Ltd.)

F# – Euler Problem 10 (Mark Pearl)

Seq.unfold (Bohdan Szymanik)

Back to school : Getting to know F# - Mehfuz's WebLog (mehfuzh)

Slides from Combinators, DSLs, HTML, and F# (Robert Pickering)

Steve's Tech Talk : Using a Proxy Class to Fix F# Protected Access ... (Steve Hawley)

 

Tools

FastSharp 2.0 (Matt Manela)

NDjango 0.9.8 (Michael Feingold)

F# Project Extender 0.9.3 (Michael Feingold)

Quantifa: F# open-source project for quantitative finance and risk management (Don Syme)

VsVim (Jared Parsons)

So many links, all well worth your time.  I know one thing I won’t be missing is Don Syme’s online talk at C4FSharp on 8/17.  It’s great to be part of a language community in which the founder interacts in such a direct way.

 

News

Draft F# Component Design Guidelines now Available (pdf)

Don Syme will be speaking online for the Community for F# on 8/17

I’ll be speaking at the NYC ALT.NET User Group on 8/25

Kevin Hazzard’s Slides from DevConnections are up

Howard Mansell will present Eden: (An F#/WPF framework for building GUI tools) at CUFP

F# is now at 93% on langref, only 1% behind scala. (Great Going!)

PexForFun.com now has puzzles for F#

FSharp Cross Platform Packages and Samples 1.1 Released

 

 

Audio/Video

Jon Harrop at the London F-Sharp User Group: QR Decomposition

This lecture takes the audience from a tiny numerically-robust implementation of a common linear algebra algorithm through several stages of optimization, culminating in a high-performance solution that easily outperforms Intel’s Math Kernel Library. The algorithm studied is QR decomposition, which is commonly used for linear least squares best fit.

 

 

F# Articles

Adam Granicz’s Expert F# 2.0 – what’s new?

There comes a time when you just have to stop working for a minute and take a few moments to enjoy the fruits of your hard labor. For me, one of these moments lately came when I received the author copies of our book, Expert F# 2.0

 

Daniel Mohl’s F# Templates Now On Visual Studio Gallery

As Don Syme mentioned in a recent blog post, I've been working to get the five F# templates that have been announced on this blog up on Visual Studio Gallery.  I'm happy to say that all are now available.

 

Vagif Abilov’s Mock framework challenges in F#

So far I only tried very basic mocking described in the first post of Richard’s series: faking return value. As I expected, even such a simple operation became a challenge when executed from F# code. I managed to make tests work only for two and half frameworks.

 

Mauricio Scheffer’s Figment: a web DSL for F#

As I said, this is very much work in progress, and there's still a lot to do. I intend to make it fully open source when I finish writing my thesis.

 

Neil Carrier’s Segment Tree in F#

Suffice to say that a segment tree stores a group of intervals on an ordered set, in such a way that all the intervals containing a given value can be efficiently located. Such a query is sometimes called a “stabbing query,” because it’s like sticking a spear through the data and seeing which entries get stabbed.

 

Neil Carrier’s F# Sequence Lazy Evaluation Gotchas

Today’s post will be old news to experienced F# programmers. Actually, it’s old news to me, relative newcomer that I am. However, it’s one of those things I tend to forget until it jumps up to bite me, as it did today.

 

Edgar Sanchez’s F#, the ACM, and the SEC

And it is this last recommendation on DSLs that carries interesting news for F# because at the end of page 6 it states “Experience seems to show that higher-order programming languages such as F# provide a particularly good basis for domain-specific languages.

 

Jon Harrop’s Pure F# now only 2× slower than OCaml

This is a surprising and encouraging result not only because it makes F# competitive for an even wider variety of tasks but because it also implies that Microsoft are taking F# so seriously that they are optimizing the .NET garbage collector for it!

 

Steve Hawley’s Protect Yourself

One solution is to label things that need to be protected, disassemble the output, run a regular expression to search/replace the accessibility and reassemble.

 

F# and .NET needed at Credit Suisse? Is there a future for this and Microsoft in the quant world?

As I said, when you compare to these other languages in the world of quant, F# appears to be taking an early lead.

 

Stefano Ricciardi’s Project Euler Problem 4 in F#

The actual algorithm uses brute force to test for palindromicity (neologism?) all the numbers that can be composed multiplying together 3 digits numbers (those from 100 to 999), picking the highest one.

 

 

Miscellaneous

Lambda the Ultimate’s OSCON 2010 Emerging Languages Camp Roundup

It’s Friday and once again I’ve gathered up more F# content for your viewing pleasure.  If you happen find yourself in the Boston area this next Monday come meet me for our New England F# User Group meeting.  We are always happy to have new people interested in checking out functional programming.

 

News

VS2010 Keyboard Shortcuts Now Available in Letter and A4 Size

F# samples are 74% complete on langref.org (nudge nudge)

Two Contract Positions: F# Interactive in Silverlight

Scott Theleman will be speaking at New England FSUG on 8/2

 

Audio / Video

eXpress Persistant Objects and the F# Language

 

 

Articles

Don Syme’s Some F# Project Templates Available Online and Daniel Mohl’s An F# Silverlight MVVM Mutli-Project Template

If you have your own templates or projects-that-could-be-turned-into-templates, here are the steps to make and publish a template to the Visual Studio Gallery, making it really easy to access by the whole community.

 

Ben Hutchison’s Study Functional Programming or Be Ignorant

Right now, if you want to understand the state of the art in computer programming, those are your choices as I see them.

 

Bohdan Szymanik’s Heat/Image Mapping with .NET/F#

Most of the effort was spent aggregating and binning the data, the actual image prep was trivial. The following assumes you have an array of data to display.

 

Neil Carrier’s Cartesian Product of Lists in F#

So without further ado (other than to note that all the code here is presented "as-is" and without warranty or implied fitness of any kind; use at your own risk) here is my Cartesian product of lists code.

 

Jared Parsons’ Converting System.Func<T1..TN> to FSharpFunc<T,TResult>

Interop of delegate style types between F# and other .Net languages is a pain point that results from a fundamental difference in how delegates are represented in the F# language.

 

Steve Hawley’s Limit Your Memoization, Please

So the lesson in this (and in many CS problems) is that you need to really understand the specific domain of your problem before applying a sweeping technique like memoization.

 

Cameron Taggart’s Exploring the GAC with F# and Mono.Cecil

Mono.Cecil can be used to look inside assemblies. May be you want to search GAC to find types that implement a certain interface. In this post, I’ll show how to find all the types that implement IDisposable as an example.

 

Cameron Taggart’s Find Authenticode Signed Assemblies

Mono.Security can be used to check for the presence of an Authenticode signature on a assembly.

 

Gary Short’s XPO – F# Lists and Seqs Oh My!

Let’s assume we have a small database of people and we wish to calculate the combined age. The functional method of doing that would be to “fold” the elements of a collection of People over a function that accumulates the age of each person, in an accumulator value, which is threaded through the fold.

 

Mark Pearl’s F# Euler Problem 9

After some more thinking, I decided to use tuples instead and generate the permutations using the Seq.unfold method.

 

Maurizio Colucci’s How F# adapts to the way we think – part1

This is the first episode of a series meant to show how easily F# adapts to the way we think. I assume no knowledge of functional languages, but I do assume knowledge of an imperative language such as C#.

 

Wiston Gubantes’ F# Asynchronous Programming

Async programming in functional languages such as F# is such a breeze....

 

 

Community

Stack Overflow: Immutable data structures performance

Stack Overflow: Functional Reactive F# - Storing States in Games

One of my favorite things about the F# community is that its members tend to build things that are a bit more interesting, and think about concepts that are a bit deeper.  This week is no exception.  Come on in and see what’s been happening in the F# world.

A quick note to those giving F# talks or running events: If you would like listed here please don’t hesitate to contact me via the email link at the top of the page.  I’d love to help you help others to learn F#.

 

Events

Nashville Geek Lunch 11:30 AM Next Tuesday (7/27/2010)

 

 

Articles

Tomas Petricek’s The Duality of Object and Event references

In this article, I'll talk about an interesting example of duality that (to my best knowledge) wasn't described by anyone before. The two dual structures are references between objects in a normal program and references between events in a reactive application.

 

Marius Bancila’s Resources for the F# Presentation at Ronua Roadshow

The program that I shown exhibits traits of both functional (for computing the fractal) and object oriented (for displaying the fractal) paradigms.

 

Neil Carrier’s A Two-Instruction Virtual RISC

One of my favorite hobbies is building really tiny virtual computers. The experience has even paid off a time or two when I needed to create a compact domain-specific language (DSL).

 

Neil Carrier’s F#'s Little-Known (?) and (?<-) Operators

These two operators work similar to the C/C++ “stringizing” pre-processor operator. That is, they convert non-string code (limited to simple identifiers in the case of F#) into strings according to the following translation patterns:

 

Julien Ortin’s Arbitraging bookmakers with F#

The principle is rather simple.  Take the best quotes for each outcome, and process.  If the sum of 1/quote_i is less than one, an arbitrage opportunity exists.  The amount to bet on each outcome is 100/quote.

 

Vladimir Matveev’s Tricky late binding operators

F# Dynamic and DynamicAssignment operators are not as simple as they appear ex facte. Most popular sample of their usage is something like this:

 

Vladimir Matveev’s Playing with WebSharper

As a sample we’ll make simple StickyNotes application. Web design is not my primary and favorite skill, so I'll omit cross-browser compatibility and bind all styles to Firefox.

 

Naveen Srinivasan’s Using F# to Automate Reading–The Morning Brew

I like to try and automate most of the stuff . So I thought why not write a script that reads the Morning Brew feed, filter the excluded content that I am not interested in and open the urls before I come in.

 

Steve Gilham’s Building PartCover 4 on Vista

Following on from earlier in the week, I pulled the current trunk from SourceForge, and set about building it then putting it to work on some F# code which had caused an earlier version (the most recent available at the end of last year) to balk.

 

Gert-Jan van der Kamp’s Using a DataReader like a list in F#

This article demonstrates a technique how you can write recursive algorithms in F# using a Reader instead of a list, so you don't have to load all your data into memory first.

 

Steve Jenson’s Building F# on Mac OS X

Joe says his team at Microsoft runs into these issues often with users and was kind enough to walk me through the steps to get F# running on the mac.

As promised, a fresh batch of links to sooth your aching desire for more F#.  I’m particularly excited to announce I’ll give giving a F# tutorial this year at the Commercial Users of Functional Programming conference.  CUFP is going to have a lot of great content this year and will be well worth attending for anyone interested in functional programming.

 

News

FAKE – F# Make 1.40.5.0 Released

F# Jobs at Credit Suisse, London

I’ll be giving a F# tutorial at CUFP

 

 

Video

Steffen Forkmann speaks on F# Open Source Tools at the New England F# User Group

Presented at the New England F# User Group on June 7, 2010, Steffen discusses FAKE and NaturalSpec. Steffen is the author of the two open source F# projects "FAKE - F# Make" and "NaturalSpec".

 

 

Articles

Alex Pedenko’s Introducing Furious – A proof-of-concept RRM for F#

Meet furious. Furious is a RRM - a Record Relation Mapping system. It is a database-independent object query dsl for records, that currently has a (barebones) mysql implementation. Here's how it works. Suppose you have a record graph like so…

 

Vagif Abilov’s Exploring Amazon S3 with F#

The purpose of this article is to show how fast you can dig into low level details of an unknown technology using F#, and how little code you need to write. Therefore I keep the text of the article short, focusing just on the required steps.

 

Yin Zhu’s F# Async workflow application: a Flickr crawler

My strategy is to use the search query to search images with some specific tags and from the result page(as shown below), the url of each image is extracted, from which the image and its tags are then crawled.

 

Daniel Markham’s F# Versus Microsoft's Regex. A Lesson in Types

I was doing some text processing. As part of that, I set up a few RegExes. As I continued coding, I realized that I was following a pattern: apply the regex, check the match count, and if there were a bunch of matches, either get the first or last item.

 

Jon Harrop’s F# vs Mathematica: an even faster pricer for American options

This new optimized and parallelized F# solution is now a whopping 960× faster than the original Mathematica code from Sal Mangano's Mathematica Cookbook.

 

Neil Carrier’s Pure OOP – A Personal Retrospective

Almost instantly, my thoughts about the problem undergo a phase change, and I re-write my earlier code to be more succinct, maintainable, and composable, and usually more computationally efficient.

 

Neil Carrier’s Integer Square Roots

This is an old algorithm, once popular in assembly language programs on small processors. The fact that it uses only integers, addition, subtraction, and less-than branching, mean that its hardware and software requirements are at rock bottom.

 

Julien Ortin’s F# Event module extension

Functions to extend the F# Event module.

 

Julien Ortin’s Socket helpers in F#

This post describes a module to perform common socket operations using asynchronous operations and reactive programming.

 

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.

 

Petr Lepilov’s F# interactive, AppFabric cache and PowerShell Part 1 and Part 2

Applications can store any serializable CLR object without worrying about where the object gets stored. Scalability can be achieved by simply adding more computers on demand. The cache also allows for copies of data to be stored across the cluster, thus protecting data against failures. It runs as a service accessed over the network.

 

Steve Gilham’s dotcover 1.0 beta – first impressions

Not having R# at home -- because I rarely use C# even if I'm writing for .net -- it's this which interested me more. So, I gave it a try on my current F# project

 

Kurt Schelfthout’s F# and Code Contracts: not quite there yet

In this post I’ll show how you can get Code Contracts sort of working for F#. From my very initial explorations, I would conclude that they seem basically usable for F# programming – but you’ll need some glue and tape, and not everything works as you’d expect.

 

Edmon Begoli’s Scala vs. F#, Application Programming Features Round 1 and Round 2

F# and Scala, two relatively recent programming languages, provide most .NET and Java software developers with new functional programming features that are worth understanding and evaluating.

 

Ivan Towlson’s F# pattern matching for beginners, Part 1, Part 2 and Part 3

Pattern matching provides a concise but clear and highly expressive way of writing conditional logic, because it combines the conditional flow with the ability to extract values of interest

About a year ago I was working on building our DotTwain ActiveX control and wrote two articles on some useful tips that I discovered.  Since that time, I’ve seen a problem on a few customer computers where, after upgrading once, the control would never run.  Instead, it would just try to reinstall after every page load.

After much frustration, it turned out that the problem is related to a little-known Internet Explorer registry entry called VerCache. 

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{GUID}] "VerCache"

I figured this out after noticing that every machine exhibiting this problem had the same value for VerCache.  Once the VerCache was set to this value, uninstalling did nothing.  The repeated-reinstallation behavior happened with any new version installed which shared the control GUID.

 

 

What’s a VerCache?

Strangely enough, searching for “VerCache” ActiveX gives you little more than an IE Team blog post and one MSDN forums entry.

At first, I was very excited when I found this IE team blog post.  It appeared that I had found my solution.

Here in the above mentioned screenshots they both are having same file date time stamps and that Causes the VerCache registry key to not get updated.

To resolve this , ensure that at least one of these parameters - “Created” date time stamp, “Modified” date time stamp or the file size, on the updated control is different from the old version of the control and you should be GTG!

Unfortunately, this information seems to be incorrect, or at least overly vague.  I observed the same bad VerCache value on different machines with different version of the control.  Each of these had different “created” and “modified” time stamps.  In fact, the CAB, the installer in the CAB, and the control assembly itself each had different “created” and “modified” time stamps for every single version.  I even tried updating the INF and setup launcher timestamps to no avail.

The only thing which did not vary consistently was file size as we rebuild and repackage our control for each DotImage version we release.

 

 

Some of the things I tried or considered.

Early on, I discovered simply deleting the registry key after uninstalling fixed the issue temporarily and was under the impression that it was a single bad version of the control causing this.  So, I wrote a small cleaner utility to fix the issue.  However, as time wore on it was apparent that this issue occurred in a somewhat random fashion with all versions of the control.

Another simple fix I thought about was updating the control GUID with each version.  However, this would require updating both our documentation and demos with every build.  Additionally, our customers would need to update their javascript with every upgrade.  This was unacceptable.

The next thing I tried was to have the installer launch a custom console program on install which cleaned the registry value.  This worked great in XP.  However, in Windows 7 the console program, even as admin, did not have access to the registry values I wanted to delete.

 

 

Finally, a solution.

In the end the only solution I found worked consistently and met our needs was to put custom installer actions into the control itself.  When both installing and uninstalling the installer calls the control’s custom actions which removes any existing VerCache value for the control.

 

First, I snagged a class I had made previously for cleaning guid-based registry entries:

Code Snippet
  1. public delegate bool RegActionBreakOnTrue(RegistryKey basekey, string key);
  2.  
  3. public class EventArgs<T> : EventArgs { private T eventData; public EventArgs(T eventData) { this.eventData = eventData; } public T EventData { get { return eventData; } } }
  4.  
  5. public class RegGuidCleaner
  6. {
  7.     string _guid;
  8.     public RegGuidCleaner(string guid)
  9.     {
  10.         _guid = guid;
  11.         Locations = new string[] {};
  12.     }
  13.  
  14.     public string[] Locations { get; set; }
  15.  
  16.     public RegistryKey GetPathBase(string path)
  17.     {
  18.         RegistryKey baseKey;
  19.         if (path.StartsWith(@"HKEY_CURRENT_USER\"))
  20.             baseKey = Registry.CurrentUser;
  21.         else if (path.StartsWith(@"HKEY_LOCAL_MACHINE\"))
  22.             baseKey = Registry.LocalMachine;
  23.         else
  24.             throw new ApplicationException("Unexpected location type: " + path);
  25.         return baseKey;
  26.     }
  27.  
  28.     private string GetBaselessPath(string location)
  29.     {
  30.         string truncatedLoc = location.Substring(location.IndexOf('\\') + 1);
  31.         return truncatedLoc;
  32.     }
  33.  
  34.     public void PerformRegActionForEach(RegActionBreakOnTrue action)
  35.     {
  36.         foreach (var location in Locations)
  37.         {
  38.             string fullPath = location + _guid;
  39.             RegistryKey baseKey = GetPathBase(fullPath);
  40.             string baselessPath = GetBaselessPath(fullPath);
  41.  
  42.             if (action(baseKey, baselessPath))
  43.                 break;
  44.         }
  45.     }
  46.  
  47.     public bool EnteriesExist
  48.     {
  49.         get
  50.         {
  51.             bool doesKeyExist = false;
  52.             PerformRegActionForEach((baseKey, subkey) =>
  53.             {
  54.                 var key = baseKey.OpenSubKey(subkey);
  55.                 if (key != null)
  56.                 {
  57.                     doesKeyExist = true;
  58.                     return true;
  59.                 }
  60.                 else
  61.                     return false;
  62.             });
  63.             return doesKeyExist;
  64.         }
  65.     }
  66.  
  67.     public void DeleteEntries()
  68.     {
  69.         PerformRegActionForEach((baseKey, subkey) =>
  70.         {
  71.             try
  72.             {
  73.                 Messages(this, new EventArgs<String>("Deleting Registry Key: " + baseKey.ToString() + @"\" + subkey));
  74.                 baseKey.DeleteSubKeyTree(subkey);
  75.             }
  76.             catch (Exception ex)
  77.             {
  78.                 Messages(this, new EventArgs<String>(ex.ToString()));
  79.             }
  80.  
  81.             return false;
  82.         });
  83.     }
  84.  
  85.     public event EventHandler<EventArgs<String>> Messages = delegate { };
  86. }

Please forgive the catch (Exception ex).  So far it has been unnecessary to handle failure cases for anything other than logging.

 

Next, I added a custom installer class to remove the entries:

Code Snippet
  1. [RunInstaller(true)]
  2. public partial class RegistryCleanerInstallerClass : Installer
  3. {
  4.     public RegistryCleanerInstallerClass()
  5.     {
  6.         InitializeComponent();
  7.     }
  8.  
  9.     private void CleanVerCache()
  10.     {
  11.         try
  12.         {
  13.             RegGuidCleaner cleaner = new RegGuidCleaner("{" + typeof(AcquisitionControl).GUID + "}");
  14.             cleaner.Locations = new string[] {
  15.                 @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\",
  16.              };
  17.  
  18.             cleaner.DeleteEntries();
  19.         }
  20.         catch { }
  21.     }
  22.  
  23.     [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
  24.     public override void Install(IDictionary stateSaver)
  25.     {
  26.         base.Install(stateSaver);
  27.         CleanVerCache();
  28.     }
  29.  
  30.     [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
  31.     public override void Commit(IDictionary savedState)
  32.     {
  33.         base.Commit(savedState);
  34.     }
  35.  
  36.     [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
  37.     public override void Rollback(IDictionary savedState)
  38.     {
  39.         base.Rollback(savedState);
  40.         CleanVerCache();
  41.     }
  42.  
  43.     [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
  44.     public override void Uninstall(IDictionary savedState)
  45.     {
  46.         base.Uninstall(savedState);
  47.         CleanVerCache();
  48.     }
  49. }

 

I also decided to move the com registration into a custom action as well.  The installer-based registration had been intermittently not working which caused us to hand test every release version of the control before sending it out.

Code Snippet
  1. [RunInstaller(true)]
  2. public partial class ComRegisterInstallerClass : Installer
  3. {
  4.     public ComRegisterInstallerClass()
  5.     {
  6.         InitializeComponent();
  7.     }
  8.  
  9.     [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
  10.     public override void Install(IDictionary stateSaver)
  11.     {
  12.         base.Install(stateSaver);
  13.  
  14.         try
  15.         {
  16.             RegistrationServices regSrv = new System.Runtime.InteropServices.RegistrationServices();
  17.  
  18.             if (!regSrv.RegisterAssembly(
  19.                 this.GetType().Assembly, AssemblyRegistrationFlags.SetCodeBase))
  20.             {
  21.                 throw new InstallException("Failed to register componenet for COM interop");
  22.             }
  23.         }
  24.         catch
  25.         {
  26.         }
  27.     }
  28.  
  29.     [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
  30.     public override void Commit(IDictionary savedState)
  31.     {
  32.         base.Commit(savedState);
  33.     }
  34.  
  35.     [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
  36.     public override void Rollback(IDictionary savedState)
  37.     {
  38.         base.Rollback(savedState);
  39.  
  40.         try
  41.         {
  42.             RegistrationServices regSrv = new System.Runtime.InteropServices.RegistrationServices();
  43.  
  44.             if (!regSrv.UnregisterAssembly(this.GetType().Assembly))
  45.             {
  46.                 throw new InstallException("Failed to unregister componenet for COM interop");
  47.             }
  48.         }
  49.         catch
  50.         {
  51.         }
  52.     }
  53.  
  54.     [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
  55.     public override void Uninstall(IDictionary savedState)
  56.     {
  57.         base.Uninstall(savedState);
  58.  
  59.         try
  60.         {
  61.             RegistrationServices regSrv = new System.Runtime.InteropServices.RegistrationServices();
  62.  
  63.             if (!regSrv.UnregisterAssembly(this.GetType().Assembly))
  64.             {
  65.                 throw new InstallException("Failed to unregister componenet for COM interop");
  66.             }
  67.         }
  68.         catch
  69.         {
  70.         }
  71.     }
  72. }

 

Finally, I added the the custom action calls to the installer.

customAction1

customAction2

 

This still won’t allow an existing broken control to upgrade.  However, after manually uninstalling the old control, the new one will install and work fine.  At least that’s what I’ve found in IE 8.0.7600.16385 Update 0 on Windows 7 Enterprise 64-bit.  ActiveX tends to be a bit of a moving target these days.

Now, let’s hope I never need speak of this again.

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.

As always, a huge number of software releases and high quality articles this week.  My favorite thing about the F# community is that someone is always writing about something that tickles my brain.  While right out of a computer science textbook, I enjoyed Erik Schulz’s sorting animations quite a lot.  His animations are excellent.

 

News

VS2010 Pro Power Tools Released (fixes scrolling reference dialog)

A set of extensions to Visual Studio Professional (and above) which improves developer productivity.  Includes a New ‘Add Reference’ dialog: Pops up fast and is more pleasant (less frustrating) to use.

 

HuwmanCode 0.1 Released – Simplified Windows Services in F#

HuwmanCode is a collection of libraries intended to enhance the base class libraries for developers writing F#. Using HuwmanCode you can write a Windows Service in F# entirely.

 

F# Project Extender 0.9.3 Released

Installing F# Project Extender provides tools to better organize files in F# projects by allowing project subdirectories and separating file management in Solution Explorer from controlling compilation order.

 

VCC 2.1.30625 Released (Written in F#)

VCC is a mechanical verifier for concurrent C programs. VCC takes a C program, annotated with function specifications, data invariants, loop invariants, and ghost code, and tries to prove these annotations correct. If it succeeds, VCC promises that your program actually meets its specifications.

 

Fing 0.1 Released

Fing is F# API Search. It's inspired by Hoogle, although it is not a port.

 

 

Audio/Video

Tomas Petricek at the London F# User Group – Reactive Programming in F#

During this talk, Tomas will cover two techniques. We'll start by looking at F# events and declarative approach for specifying event processing. Next, we'll look at embedding F# event handling into asynchronous workflows and programming using "state machines". We'll also briefly mention how this relates to more general functional programming "design patterns".

 

A Listing of F# TechEd Talks, at the New England F# User Group

A complete listing of all TechEd talks pertaining to F#.  Thanks Talbott!

 

 

Articles

Antonio Cangiano’s How Microsoft is changing the programming world.

The end result of Microsoft’s new approach is that now Joes everywhere are getting exposed to functional programming (masses of people who would otherwise be virtually shielded from the rest of the programming world).

 

Erik Schulz’s Cartesian Tree Sort, Insertion Sort, Priority Queue & Heap Sort, Heap Sort, Selection Sort, Quick Sort, Gnome Sort, Comb Sort, Odd-even Sort, Cocktail Sort, and Bubble Sort.

Inspired be Wikipedia's algorithm pages I decided to recreate their animations using JavaSrcipt and HTML5 canvas elements. IE 8 does not support canvas however new versions of all other modern browsers do. Mozilla Firefox, Google Chrome, Safari, and Opera.

 

Laurent Le Brun’s F# + OpenGL: a cross-platform sample

The nice thing is that the application was cross-platform. I tried it on Windows, Linux and Mac, it worked everywhere, without changing a single line. It seems like F# is ready to make great cross-platform 3D applications!

 

Daniel Mohl’s An F# WPF MVVM Project Template

I've been planning for a while to create an F# WPF MVVM Template to add to the other templates that have been announced on this blog.  A resent post by Mark Pearl provided a great simple example which helped kick me into gear and bring this plan to fruition.

 

Jomo Fisher’s Use FsLex and FsYacc to make a parser in F#

The starter project implements a simple calculator language that you can grow into a more sophisticated Domain Specific Language or text processing application.

 

Julien Ortin’s SEO helpers in F#

In this post, we describe how to implement functions that help fetch information that can be used to study how well (or bad) the keywords are used on a given website in comparison with other (successful) competitors.

 

Neil Carrier’s Flip Operator for F#

I ask again: is there a good native way to do this in F#? If not, it might well worth standardizing this. (And potentially other FORTH-like operators like “over” and “rot,” perhaps with an extensible syntax.)

 

Joel Björnson’s Fun with dependent formlets (in WebSharper)

To give some hints of what you can do with the WebSharper formlet library, the objective of the following exercise is to create a simple spread-sheet like widget based on formlets.

 

Joel Björnson’s More of Ext JS and WebSharper

In general, seamlessly being able to create data abstractions and transfer data back and forth between the server and client is a very strong incentive for using the WebSharper extension.

 

Joel Björnson’s Reactive programming with WebSharper

In following post I'd like to highlight F# (and WebSharper) support for asynchronous and reactive programming.

 

Mark Pearl’s F# Seq.Unfold

The more I play the more I am really loving F# and how succinct the language is.  Today I thought I would put up a brief post on the Seq.unfold function.

 

Daniel Merino’s Testing F# (with Traveling Salesmen)

The next example is a little snippet that returns a dictionary distances between cities for a small distributed traveling salesman problem I did last year to test F# on a software engineering class.

 

Richard Minerich’s Love the Lambda

So the idea for Love the Lambda was born:  I would demonstrate both the usefulness and sheer novelty of first class functions and do so simultaneously in C# and F#.  More than that, I would use the opportunity as a kind of F# omnibus.

 

Pete Hunt’s F# rocks (so far)

I have to say, I really like F# so far. For those of you not in the know, F# is Microsoft’s new first-class language that has been in development since 2002 but debuted in Visual Studio 2010. It is basically a dialect of O’Caml that runs on .NET and has full Visual Studio support.

Despite the small number of talks on F#, it seemed the language was on everyone’s lips this TechEd.  Whether working at the Visual Studio Languages booth or hanging out at the parties afterward, almost everyone I talked to was actively investigating or making plans to explore the language. 

Of course, this is great news.  A quiet tide of interest is quickly rising.  Now we just need to give those who are interested the resources they need to be successful and comfortable using F#. 

For this reason, each and every F# speaker and blogger is critically important right now.  If you haven’t, don’t be afraid to give blogging a try.  The F# community is helpful and very forgiving of mistakes.  If you are already blogging, consider giving a talk at your local user group or code camp.  Now is the best time to help and educate.

 

News

Daniel Mohl will be speaking at FSUG on 7/5

IT University of Copenhagen uses F# as presentation language in a course: “Programming Language Concepts for Software Developers” (Thanks Pheophan)

Project Emporia Released, on Azure with a F# Core

FsCheck 0.7 Released

 

Video / Audio

Luke Hoban’s F# in Microsoft Visual Studio 2010 (video) and F# Scaling from Explorative to .NET Component (blog)

The TechEd talk covered a number of interesting aspects of using F# in Visual Studio - tools, core syntax, some examples of current commercial users, and the physical structure of F# projects used in client applications.  But the theme of scaling from explorative programming to .NET component is one that I find particularly powerful, and which is a really unique strength of the F# language.

 

John Hughes on Why Functional Programming Matters (video)

John Hughes is the author of “Why functional programming matters” paper and in this interview he outlines the merits of functional programming and the reason for his involvement with it. He also goes over several core principles of functional programming like monads, handling of side-effects, etc.

 

Talking Shop Down Under with Joel Pobar (audio)

This week see's Richard talking with Joel Pobar about F# and languages in general. Functional programming is coming more and more to the fore and this is a great episode to find out more about F#, try and get your head around monads and think more about the way you approach programming in general and wether the general purpose languages that you use currently are always the best choice for the job at hand.

 

Articles

Luke Hoban’s F# Fundamentals on MSDN Magazine

This article takes a look at some of the core concepts of the F# language and its implementation on top of the CLR.

 

Ashley Feniello’s Wolfram – A New Kind of Turing Machine

Stephen Wolfram’s book, “A New Kind of Science” is flippin’ brilliant! (or perhaps I'm just not brilliant enough to realize he's a mad man) 1,280 pages packed with beautiful insights and Tufte-worthy visualizations. I remember discovering it while randomly browsing the MS library one day. I became so enthralled, an hour passed just standing there reading it!

 

Vagif Abilov’s Symbolic Calculation in F# on CodeProject

One of the best areas to use a functional language is to apply it to symbolic calculations. Like transforming algebraic expressions or evaluating function derivatives. I remember how I was impressed many years ago when I looked at a program in Prolog that occupied not more than one computer screen but could tell me that derivative of sin(x) was cos(x). So I wanted to do the same in F#.

 

Don Syme’s HTML5 Programming with F#

Now that WebSharper has been released and matured, it will be great to see it used more widely by F# users.  Given the importance of both HTML5 and Silverlight, F# users interested in shipping visualization apps should really make sure they know how to use F# to program these, using the Silverlight SDK (for Silverlight) or tools such as WebSharper (for HTML5).

 

Chris Smith’s F# active pattern seven-tag limit

Once he went into the theory behind active patterns I agreed that the limit was reasonable and didn't push for us to change the design. This doesn't mean you can't use active patterns with greater than seven tags, it just means that you need to use a different language construct -- the partial active pattern -- instead.

 

Phillip Trelford’s Runtime Units of Measure for F# and Units of measure auto-conversion

The F# compiler includes a Units of Measure feature which infers a measure type at compile time, which means you get measure type safety with uncompromised runtime performance. […] Sometimes you might also want to actually infer units of measure at runtime, say to display the inferred unit type at the UI. The following F# code prototype provides such inference.

 

Phillip Trelford’s Silverlight 4 Calculator Sample in F#

The sample demonstrates creating a View in WPF or Silverlight without XAML. The idea is to make things a little easier from F# by implementing a (+) operator overload to attach dependency properties.

 

Jomo Fisher’s Creating an OData Web Service with F#

If you’d like to take a look at the service I wrote, I published it on Visual Studio Gallery. You just need to go to File\New Project in Visual Studio 2010:

 

Jon Harrop’s A dragon curve in 17 lines of F#

Dragon curves are a family of self-similar fractal curves. The following 17-line F# program uses Windows Presentation Foundation to visualize the results of a simple recursively-constructed dragon curve.

 

Neil Carrier’s List<>.collect Implementations with Benchmarks and One more List<>.collect Implementation

I had a situation come up in my proof-of-concept where I needed to do a collect on a .NET List<>. So I did some experiments with how it might best be accomplished. A key factor was that this is something that may be done literally millions of times a day if the application makes it to deployment; so I was concerned with performance.

 

Neil Carrier’s Easy, No-Compile DFAs

The methods for compiling a set of finite automata DFAs or NFAs into a composite DFA are found in most introductory compiler texts. But how easy is it to construct a simple engine in F# which recognizes a series of patterns? As it turns out, pretty simple.

 

Neil Carrier’s Surfing the Tuple Pipeline

It turns out that I like the RWFP approach better than mine, but the special tuple pipelines I came up with are not without interest, so I decided to post them here.

 

Neil Carrier’s This is why I love F# Part One and Part Two

I can’t imagine having any trouble explaining the operation of this program to someone with a basic knowledge of statistics but no computer programming experience. It simply looks like what it does in a way that is succinct and comprehensible.

 

Daniel Mohl’s The Standard WCF Service Application Template for F#

In the interest of building up a larger set of installed templates for F#, I've ported the standard C# WCF Service Application to F# and packaged it into a .vsi file.

 

Daniel Mohl’s FSharpCouch: A Simple CouchDB .NET API in F#

To interact with CouchDB, I primarily use Relax (a full featured ".NET API abstraction of CouchDB's (excellent) RESTful API"); however, I thought it might be fun and educational to create a simple CouchDB .NET API abstraction in F#.  Note: The code provided  here is loosely based on SharpCouch.

 

Vladimir Matveev’s F# Parsing simple language

During my professional career I often met the task of code generation based on some source data. Last time it was analogue of BCL compiler for ExpressionTrees and then C# compiler have done mostly all the required job with parsing expressions.

 

Vladimir Matveev’s F# Performance of events and F# Performance of events (update) and Rick Minerich’s A Speedy Alternative to F# DelegateEvents

As you see compiler have inlined code of Trigger method inside Run  and accessed field multicast directly. That’s why we replaced let binding with val.

 

Laurent Le Brun’s F# and FParsec: a GLSL parser example

One of my side-projects is GLSL Minifier.  GLSL is the shading language of OpenGL, that is a language designed to run on the GPU, in order to control the graphics pipeline and create nice realtime graphical effects.

 

Laurent Le Brun’s F# getopt to parse the command line

Many programs (especially console applications) need to parse the command line, and find which options the user want to set. As far as I know, .NET doesn't provide any function for this, but there several third-party libraries to do it.

 

Yin Zhu’s A note on efficiency in F#, part I: small things first

As a functional programming language, F# programs are kind of high-level, thus harder to reason its performance than imperative programs. Not the big-O thing, it is the constant. This series contains little tips about performance.

 

Mark Pearl’s F# WPF Form – the basics

I have been keeping my eye out for some examples of creating a WPF form in a F# project and came across Tim’s F# Twitter Stream Sample [..] So today I am going to make just the very basic WPF form with all the goodness of a XAML window.

 

Mark Pearl’s Simple Mouse Move Event in F# with WinForms

In Thomas’s post he has a form with an ellipse on it that when he clicks on the ellipse it pops up a message box with the button clicked… awesome. Something that got me on the post though was the code similar to the one below…

 

Ming Tang’s F# Multidimensional Arrays and Jagged Arrays

The problem is that, an array is initialized per every rows, which wastes computational resource. Because the widths of each row are constant, why not make a 1d array and access pixels like y * width + x.

 

Pheophan’s Fun with Fibonacci

“Horrible performance. fibnaive 40 took 16.6 sec on my laptop" […] “It’s also pretty fast. Here are results of calculating 1000 Fibonacci numbers: Real: 00:00:00.001, CPU: 00:00:00.000, GC gen0: 0, gen1: 0, gen2: 0”

DelegateEvents use DynamicInvoke under the hood and so can be slow when trigged frequently.  As we have an existing model which requires an event interface, this was was causing our F# implementation to be a bit slower than the C# we were comparing it to.  Thankfully, F# allows you to implement your own eventing via IDelegateEvent.  With a standard Invoke version of DelegateEvent provided by James Margetson, our implementation in F# is running at equivalent speed to C#.

The other day I was working with Steve on trying to discover why a particular segment of apparently equivalent code was running ~25% slower in F# when compared to C#.  We broke out AQTime and did a line by line release-mode profile.  The frequent triggering of a DelegateEvent immediately jumped out as the cause. 

Needless to say, I was a bit concerned.  What could be causing this slow eventing in my favorite language?  After a brief review of the generated IL, nothing in particular seemed fishy.  So, I quickly built a sample and sent it off to my favorite language team.

 

The contents of the F# library assembly:

type FsEventClass(num) =
    let event = new DelegateEvent<System.EventHandler<System.EventArgs>>()
    
    [<CLIEvent>]
    member this.Event = event.Publish
            
    member this.Run () =
        let args = [| this :> obj ; System.EventArgs.Empty :> obj |]
        for i in 1 .. num do
            args.[1] <- new System.EventArgs() :> obj
            event.Trigger( args )

 

And this, the C# client:

static void Main(string[] args)
{
    int iters = 1000000;

    DateTime fsStart = DateTime.Now;
    FSharpEventingLib.FsEventClass fs = new FSharpEventingLib.FsEventClass(iters);
    int fsCalled = 0;
    fs.Event += (s, a) => fsCalled++;
    fs.Run();
    DateTime fsEnd = DateTime.Now;
    TimeSpan fsTime = fsEnd - fsStart;
    System.Console.WriteLine(String.Format("F# took: {0} when called {1} times", fsTime, fsCalled));
}

 

Finally, the program output:

F# took: 00:00:05.6830000 when called 1000000 times

 

As it turns out, the F#’s current DelegateEvent uses a DynamicInvoke under the hood and that can slow things down quite a bit.  This won’t be important in most cases as Event is implemented with a standard Invoke.  However, in our case we had to fit to an existing C# model and so needed to do an event trigger for each resulting scanline of an image.

A big thanks to James Margetson of the F# Team for the following fast replacement for DelegateEvent.  Within same day I had mentioned my issue he had this solution for me.  

 

The new library contents:

type FastDelegateEvent() =
    let mutable multicast : System.EventHandler = null

    member x.Trigger(sender:obj,args:System.EventArgs) =
        match multicast with
        | null -> ()
        | d -> d.Invoke(sender,args)   // DelegateEvent used: d.DynamicInvoke(args) |> ignore

    member x.Publish =
        { new IDelegateEvent<System.EventHandler> with
            member x.AddHandler(d) =
                multicast <- System.Delegate.Combine(multicast, d) :?> System.EventHandler
            member x.RemoveHandler(d) =
                multicast <- System.Delegate.Remove(multicast, d)  :?> System.EventHandler }

type FsFastEventClass(num) =
   let event = new FastDelegateEvent()

   [<CLIEvent>]
   member this.Event = event.Publish

   member this.Run () =
       for i in 1 .. num do           
           event.Trigger(this, new System.EventArgs())

 

The program output with FastDelegateEvent:

F# took: 00:00:00.0390000 when called 1000000 times

 

This new event class completely resolved our issue.  With it our F# version is just as fast, if not faster, than the C# equivalent. 

Come in and see what’s new in the F# world.  Every week is seems there is ever more content on an increasingly wider variety of topics.  The community is growing at a very fast pace.  Because of this, I’ve decided to change things up a bit with a new format.  I hope you’ll find it enhances your experience in exploring this mountain of fresh F# information.

 

News

Silverlight 4 runtime has been released with F# support

The F# PowerPack 2.0.0.0 is out and supports Silverlight 3 and 4

WebSharper 2010 1.0 is out and is free for commercial use

F# Project Extender 0.9.2.1 has been released

The CUFP 2010 and ML 2010 Call for Presentations is active

F# is on InformationWeek 500: 20 Great Ideas To Steal

 

Video / Audio

Don Syme Talks with Sadek Drobi About F# 2.0, a First Class Citizen in Visual Studio 2010

Don Syme speaks about F# 2.0, its application fields, its integration in Visual Studio 2010 and F# open source Power Pack library. Don also discusses the genesis of F#, the ties with OCaml as well as its specificity.

 

Don Syme Answering Questions on F#, C#, Haskell and Scala

In this interview made by InfoQ’s Sadek Drobi, Don Syme, a Senior Researcher at Microsoft Research, answers questions mostly on F#, but also on functional programming, C# generics, type classes in Haskell, similarities between F# and Scala.

 

Amanda Laucher and Josh Graham – The state of the Art on .NET

Amanda Laucher and Josh Graham present at an introductory level some of the most important elements of the .NET ecosystem: F#, M, Boo, NUnit, RhinoMocks, Moq, NHibernate, Castle, Windsor, NVelocity, Guerilla WCF, Azure, MEF.

 

.NET Rocks F# Panel Live from NERD Center, Cambridge, MA

While on the Road Trip, Carl and Richard recorded this panel discussion with Talbott Crowell, Rick Minerich and Richard Hale Shaw on F# at the Microsoft New England Research and Development Center. The panel makes a very compelling case for adding a functional language to your toolchest.

 

Blogs

Brian McNamara’s Proggit Subreddit Graph in F# and DGML

Dear Proggit: graphs are cool, but I prefer F#, so I graphed the subreddit interconnections with F# and DGML

 

James’ Implementing map-reduce in F#

Again, F# proves to be a remarkably succinct language to express problems, in this case the built in syntactic sugar for tuples is a godsend!

 

Daniel Mohl’s F# ASP.NET MVC 2 Web Application Template and
Creating an F# Template for Visual Studio 2010

Tomas Petricek recently provided a great blog post on creating MVC web applications in F#.  I thought it might be nice to also have a template that replicates the functionality of the standard C# ASP.NET MVC 2 Web Application template.

 

Daniel Mohl’s A Simple Inversion of Control (IoC) Container in F#

In this post I will show how to build a simple Inversion of Control (IoC) container in F#

 

Daniel Mohl’s Getting Started with WebSharper Platform 2010

A little while ago a cool new product was brought to my attention that allows client-based web development in F#.  The name of this product is WebSharper Platform 2010.  In this post, I will show a simple example for getting started with WebSharper Platform 2010.

 

Neil Carrier’s Computation Expressions with .NET Data Types

I’m still working on my proof-of-concept and it’s going well. One thing that’s been on my mind is the desire to use computation expressions in it somewhere. So I’ve been trying to make sure I understood computation expressions well enough to use them to good purpose.

 

Neil Carrier’s Active Pattern Activity and More Active Pattern Activity

I have to say the F# proof of concept is still going a lot better than I had ever hoped. Not only is it easy to port the basic algorithms from C# where applicable, but the kind of straightforward design that “functional-thinking” encourages is making for a better program with much less source code.

 

Phillip Trelford’s Exposing F# Dynamic Lookup to C#, WPF and Silverlight

Sometimes dynamic typing can be a pragmatic way of solving a specific problem. For example say you’re a solutions provider with a core product and have a number of clients with bespoke requirements. One client asks for a product rating feature. This can be relatively easily achieved using dynamic properties:

 

Phillip Trelford’s F# operator overloads for WPF dependency properties

Creating WPF elements directly from F# can produce good self-contained code, but at time is a little less readable than the XAML equivalent. Lets consider placing a button bound to a command on a grid at a certain position.

 

Clive Tong’s Towards an F# .NET Reflector add-in

When I had the opportunity to spent some time during Red Gate's recent "down tools" week on a project of my choice, the obvious project was an F# add-in for Reflector.

 

Clive Tong’s F# and the rose-tinted reflection

We're already seeing increasing use of many cores on client desktops. It is a change that has been long predicted.

 

Julien Ortin’s Technical analysis indicators in F# – Metadata and Reflection

In this part, we show how to use reflection to fetch the metadata attributes we have described in the first part of the technical analysis series.

 

Steve Gilham’s F# - excessively lazy sequences and stateful visitors

Doing something a little bit complicated here: the functional equivalent of a visitor pattern, where I want to apply a few functions to a long and potentially expensive to traverse sequence of items (so ruling out a series of iterations over the visited nodes)

 

Jon Harrop’s Mini hash table

Imagine you're stuck on a desert island with only a few keystrokes and you desperately need to create your own rudimentary hash table. What might you do?

 

Jomo Fisher’s How to Enumerate all WMI Classes

This is the F# code you would use to enumerate all WMI classes on your system and show the properties of each. of each.

 

Fredrik Holmstrom’s F# short hand syntax for maps and sets

I’ve always though it a shame that there is no in language short hand syntax for maps and sets in F#, something like {{foo = 1; bar = 2}} and {#1, 2#} – but having a very flexible language at my disposal I set out to find some way to achieve this, mostly for fun – but maybe someone will find a practical use of it.

 

Community

From StackOverflow: Scala vs F#, How do they unify OO and FP?

What are the key differences between the approaches taken by Scala and F# to unify OO and FP paradigms?

 

From StackOverflow: F# Static Member Type Constraints

I'm trying to define a function, factorize, which uses structural type constraints (requires static members Zero, One, +, and /) similar to Seq.sum so that it can be used with int, long, bigint, etc. I can't seem to get the syntax right, and can't find a lot of resources on the subject. This is what I have, please help.

Today, I’d like to thank all of the F# users on twitter. 

Twitter’s a great place to stay up to date on the latest F# happenings and many of the posts you see here are either written by or passed on from members of this community.  So, if you are interested in becoming part of the F# Twitter Community, I suggest starting with these frequent F# tweeters: @dmohl, @TigerHasse, @robertpi, @sforkmann, and @ptrelford

I’ve also been known to occasionally tweet on F# and other programming topics.  Now, on to the links.

 

Brian McNamara’s More F# Screencasts

My previous two screencasts (‘Getting started with F# in VS2010’ and ‘Editing F# source code in VS2010’) have been moved to MSDN, which means they’re now available in a variety of video formats.  A new screencast (‘Managing F# projects in VS2010’) has also been added, so check it out! 

 

Robert Pickering’s F# Talks in London

I’ve been in London for the past few days. I arrived Tuesday afternoon and gave at talk at “The F#unctional Londoners Meetup Group” on the Tuesday evening.

 

James McCaffrey’s Combinations and Permutations with F#

Understanding combinations and permutations is a fundamental skill in software testing. In this month’s Test Run column I show you how to work with combinations and permutations using code written in the new F# language.

 

Amanda Laucher and Josh Graham’s Pragmatic F# in Action (video)

Amanda Laucher and Josh Graham introduce the audience to F# basics showing some of its main features, emphasizing what makes it better than imperative languages.

 

Tomas Petricek’s ASP.NET and F# Part 1 – Creating MVC Web Applications in F#

If you want to use F# for creating an MVC application, you have a few options. It should be possible to create the web application solely as an F# project. However, we'll use a more convenient approach. We'll create a standard C# MVC project and move all the actual implementation to an F# library.

 

Steffen Forkmann’s FAKE – F# Make 1.20.0 Released and
Using a MailboxProcessor to speedup “FAKE – F# MAKE”

Today I released a new bugfix release for “FAKE – F# Make”. We fixed some path and logging issues and as a new feature we introduced the @@ operator which allows to combine paths.

 

Phillip Trelford’s Trading on IM with F#

The slides from my Trading on IM talk will be attached to this post, and the video/podcast should be appear on the Skills Matter website. I’ll also attach the 100 lines of code for shopping checkout sample, that works with a barcode scanner, I showed at the start of my presentation.

 

Daniel Mohl’s Integrating F# and Erlang Using OTP.NET

Recently, I ran across a post that talked about a .NET library named OTP.NET.  OTP.NET is a port of a Java library named JInterface that allows a .NET application to act as an Erlang node.  OTP.NET hasn't been updated in a while and the API is a bit clunky, but the provided functionality is very cool.

 

Nick Grattan’s Creating Web Parts with F# and
An EDSL for Emitting HTML Tables in Web Parts using F#

When writing web parts in C# for SharePoint the System.Web “table” class or “table” HTML elements are most often used for controlling layout (“div” aficionados keep your ears covered…). The code quickly gets ugly and difficult to manage – there’s no direct control to ensure correct matching of opening and closing of tags. So how about writing an EDSL that provides a syntax and constructs for doing this?

 

Neil Carrier’s Tiny Expert System using Monads

Below is a tiny expert system implemented using computation expressions. I managed to find a way to use the following computation expression methods: Bind, Delay, and Return.

 

Neil Carrier’s A Simple DSL: Tokenization to Evaluation,
S-Expressions for Semantic Networks and
A Half-Baked Scheme

This post presents a small example of the above process. It implements a small interpreter which analyzes and evaluates LISP-like prefix expressions involving integers, multiplication, and division. For example: (+ (* 1 2) (* 3 4) evaluates to a data element containing the number 14. To make clear what is happening, be sure and examine the value of tokenList before it is evaluated.

 

Julien Ortin’s Technical analysis indicators in F# – Bands, Signal and Ehlers

This is part of a series on technical analysis indicators in F#, based on the multi-language TA-Lib.  Quick disclaimer : some of these indicators are not verified.

 

Yin Zhu’s F# for Project Euler Problems

Some problems have two versions of solutions, the version I first learned F# and the version based on my current knowledge of F#. The first version is usually quite easy to understand even if the reader does not know F#, while the second uses some nice F# feature or good functional programming practice in general.

 

Jon Harrop’s Java vs. F#

What Cliff forgot to mention is that .NET also provides value types and a far more compelling example than complex numbers is the humble hash table.

 

Tim Ng’s F# + WPF + Events

I recently had to do some travelling for the VS launch event in Las Vegas and QCON event in Beijing. One of the things thats nice about travelling is that it gives you time to do some things you may not otherwise do - in my case, I had a chance to try to (re) learn WPF and see how I can use F# with WPF.

 

Mark Needham’s Tacit Programming

I realised that this approach quite closely describes what I've been trying to drive towards in my most recent playing around with F# and it's actually quite fun trying to drive any intermediate state or storing of data in variables out of a program and just relying completely on function composition and higher order functions.

 

Mark Needham’s F#: My current coding approach

I spent a bit of time over the weekend coding a simple generic builder for test objects in F# and I noticed that although there were similarity with the ways I drive code in C# or Java my approach didn't seem to be exactly the same.

 

Ebru Cucen’s F# vs C# Samples

After my talk at ldnUG yesterday, I got nice suggestions from Zi Makki, and here is the first one: comparison between F# and C#, especially using LINQ. This subject had been quite popular once in a while, now it is probably my time to focus on this subject.

 

Bjorn Rochel’s Kata StringCalculator in F#

Two meetings ago we decided to do some coding on every meeting. The previous meeting we solved Kata FizzBuzz and on yesterday’s meeting we tried to dance with Roy Osheroves Kata StringCalculator.

 

Gunnar Peipman’s F# in ASP.NET, mathematics and testing

Starting from Visual Studio 2010 F# is full member of .NET Framework languages family. It is functional language with syntax specific to functional languages but I think it is time for us also notice and study functional languages. In this posting I will show you some examples about cool things other people have done using F#.

 

Luis Diego Fallas’s Defining mutually recursive classes in F#

As explained in Adventures in F#--Corecursion defining mutually recursive functions requires the use of the and keyword between function definitions. As briefly mentioned in the Type Definitions section of the manual, the and keyword can also be used in types.

 

Nancy Strickland’s New Features in F# 2.0 Training Video

Describes the new features in F# version 2.0, which comes included in Visual Studio 2010.

 

DotNetRocks in Boston (with F# Panel)

The panel suggested we add F# to our repertoire and understand its strengths, and use it where it's beneficial. I'm going to take that advice. Bottom line is if I can replace 50 lines of confusing C# code with 10 lines of elegant F#, I've done myself a service.

Back this week with another huge batch of F# links.  While there’s way too much great stuff to mention, my favorite this week is by a mysterious blogger known only as James.  His heat transfer model is short, sweet and very well explained.

If you’re around Boston tomorrow (Monday) be sure to check our F# panel for .NET Rocks!  With over 100 people already signed up, it’s sure to be a great time.

 

The .NET Rocks! Visual Studio Road Trip – F# Edition in Boston (5/3/2010)

Carl and Richard are loading up the DotNetMobile (a 30 foot RV) and driving to your town again to show off the latest and greatest in Visual Studio 2010 and .NET 4.0! This stop will include an intro to F# and a special topic panel discussion on F# featuring New England F# User leaders.

 

Rob Knies’ F#: Putting the 'Fun' into 'Functional' (On Dr. Dobbs)

"In the F# team," says Syme, a principal researcher at Microsoft Research Cambridge, "We say, 'F is for Fun.' F# enables users to write simple code to solve complex problems. Programming with F# really does make many programming tasks simpler, and our users have consistently reported that they've found using the language enjoyable."

 

James’s Modelling heat transfer in F# using 100 lines of code

In this post I’m going to show how we can model the heat equation succinctly in F#. I’m going to consider the two-dimensional case and approximate the solution at discrete spatial mesh points and at discrete time periods.

 

Brian McNamara’s Game programming in F# (with Silverlight and WPF)

I wanted to learn more about Silverlight, WPF, and Xaml (in the context of F#, of course), so I wrote a fun little game you can play in your browser (or on your desktop).  It’s a knock-off of a dozen other similar games, as you can probably tell from this screenshot

 

Martin Doms’s Implementing the Mandelbrot set in F#

One of my favourite things to do when learning a new language (or graphics package for that matter) is to write an implementation of a Mandelbrot set viewer. So here’s my F# version, annotated to help out anyone who is trying to get to know this language.

 

Dmitry Lomov’s Finer Points of F# Value Restriction

Type inference algorithms are a fascinating topic – there is an interesting and beautiful theory behind them. Today we will consider one interesting aspect of type inference in F# - it might give you a glimpse of what kind of challenges coming up with a good algorithm in this space presents, and hopefully explain away a stumbling block that F# developers occasionally encounter.

 

Frank is a functional reactive request/response engine for .NET applications (written in F#)

Frank is inspired by the Ruby dynamic duo of Rack and Sinatra and aims to provide the simplicity of those frameworks but utilizing the powerful functional reactive paradigm for asynchronous processing.

 

Steve Gilham’s Launching an F# web application inside VS2010 as if it were C#

This is a follow-up to my comments on VS launcher for F# web apps, where I can put an example of the changed markup to the F# class library project to make it act like a web project and launch a browser with your Default.aspx page when you hit F5.

 

Phillip Trelford’s UML Sequence Diagram: F# Script

Yesterday I fancied moving some hand drawn diagrams to mouse drawn form; but instead found myself battling against a somewhat stubborn and forgetful modelling tool. It left me wondering if there might be an easier way to do this; perhaps by separating the concern of model description from layout.

 

Daniel Mohl’s A Distributed Hash Table (DHT) in F#: Recursion and Pattern Matching

The simplest implementation defined in the Chord Protocol requires that each node only know about its successor node.  The circle of nodes, joined by each successor node association, makes up the node cluster. In order for a node to become part of the node cluster, it must execute a join request to any arbitrary node in the cluster.

 

Daniel Mohl’s Interacting with RabbitMQ via F# and Symbiote

Last week, I showed how easy it is to talk to CouchDB with F# and Symbiote.  In this post, I'll show how you can start interacting with RabbitMQ by adding an additional dozen or so lines of code.

 

Steffen Forkmann’s Solving KataYahtzee with F# and NaturalSpec

Today I’m starting a new blog post series about solving code katas in F# and with the help of my NaturalSpec project. A code kata is a programming exercise which helps to improve your skills through practice and repetition.

 

Robert Pickering’s Strings and F# Immutable Lists

The aim of the article is to show that this is not the case, or at least it’s not as black and white as you may think. Specifically we’re going to compare how.NET strings differ considerable in performance characteristics to F#’s immutable lists.

 

Andre Burdette’s F# Screencast Series

This is the first of future screencasts that I am doing regarding F# programming. In this screencast I show how to use values and functions in the F# language. Enjoy!

 

Neil Carrier’s A Spell-Binding Tale of Three Recursions

Tail recursive functions often involve accumulators, continuations, and other values which are not really of concern to the ultimate users of those functions. These can often be curried away or otherwise hidden from the ultimate user. This post looks at three obvious techniques for doing so (there are some more that are less obvious), the differences between the three techniques, etc.

 

Neil Carrier’s Driving Range Pooled Allocator

Large numbers of small allocations can be brutal on a memory management system, especially in terms of CPU time (and in terms of fragmentation on non-GC systems). This post presents an F# implementation of a pooling algorithm I’ve used for many years, and in various languages from C onwards, to solve this problem.

 

Julien Ortin’s Technical analysis indicators in F# – Misc and Volatility

This is part of a series on technical analysis indicators in F#, based on the multi-language TA-Lib.  Quick disclaimer: some of these indicators are not verified.

 

Vladimir Matveev’s Nature of value restriction

Value restriction is an error that firstly makes a direct hit in the brain of non-prepared developer. It has no straight analogues in the majority of mainstream languages and thus very confusing.

 

Vladimir Matveev’s MailboxProcessors: Practical Application

Last time we have examined the API of MailboxProcessors. Now it is time to see, how this concept can be applied to solve real-world problems.

 

Doug Finke’s How to add an F# type to a PowerShell session

The PowerShell Add-Type cmdlet lets you define a .NET Framework class in your Windows PowerShell session. It supports the following languages CSharp, CSharpVersion3, VisualBasic, JScript. It does not support FSharp directly.

 

Mark Pearl’s F# Objects Part 1, Part 2 and Part 3

In the next few blog posts I am going to explore objects in F#. Up to now, my dabbling in F# has really been a few liners and while I haven’t reached the point where F# is my language of preference – I am already seeing the benefits of the language when solving certain types of programming problems.

 

Mark Pearl’s International Radio Operators Alphabet in F# and Silverlight Part 1 and Part 2

My approach was really simple. I would need a function that would convert a single character to a string – i.e. ‘A’ –> “Alpha” and then I would need a function that would take a string of characters, convert them into a sequence of characters, and then apply my converter to return a sequence of words… make sense?

 

Mike Hadlow’s Currying vs Partial Function Application

There’s a lot of confusion over these two terms. By myself included. But I’m pretty happy now that I understand the difference and wanted to share my newfound knowledge with you, dear reader.

 

Bjorn Rochel’s Kata FizzBuzz in F#

Last F# book club meeting in Munich was awesome (as usual). 2 weeks ago we decided to do a Code Kata on each subsequent meeting. This week was our first, with Kata FizzBuzz.  This is what we came up with.

 

Jim Lehmer’s Your language ain’t worth a pair o’ dimes

That's not to say the Real World Functional Programming book is a bad book. It has been an interesting read so far, for sure. I am just going to stop reading the C# parts, thereby allowing the new concepts and new language I am learning to be "pure" in my mind, which should actually help speed up my learning process. And my suggestion to you is if you pick up the book, do the same thing, too. Dump your baggage, start fresh!

 

Rick Minerich’s The Ted Neward F# Folding Challenge

Take a list of numbers and compress it in a particular simple way but without any mutable state.  What makes this problem interesting is that a tech interviewer mentioned that that he hadn’t seen a functional solution to this problem.  I also wanted to share this because I think it’s a great example of how to convert an imperative loop into a functional fold.

More Posts Next page »