Friday, July 30, 2010 3:03 PM
F# Discoveries This Week 07/30/2010
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.
Audio / Video
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.
Right now, if you want to understand the state of the art in computer programming, those are your choices as I see them.
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.
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.
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.
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.
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.
Mono.Security can be used to check for the presence of an Authenticode signature on a assembly.
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.
After some more thinking, I decided to use tuples instead and generate the permutations using the Seq.unfold method.
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#.
Async programming in functional languages such as F# is such a breeze....