Geeks With Blogs
Mark Pearl F#
Browser Based F# Interactive


So I love this example that I saw in one of my daily programming newsletters – F# interactive in the browser – no need for VS.

Check it out here…

Posted On Friday, January 7, 2011 11:49 AM

TechEd South Africa Dev Idol Slide – F# Tail Call Optimization
So I have put up the slides from my ten minute presentation on 1 best practice in F# up for anyone who wants them. Also find a link to Bart De Smet’s presentation on Functional Programming ......

Posted On Wednesday, October 20, 2010 4:22 PM

F# Euler Problem 16
Well after a hectic week of work and studying I eventually had some me time… today I thought I would attempt Euler Problem 16. The Problem 215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 21000? The Solution So I thought I would get to concerned about length of code, but rather focus on implementing several practices that I have learnt in the last couple of weeks, namely tail recursive functions and composite functions… I initially broke ......

Posted On Thursday, August 19, 2010 9:42 PM

A solid example of the difference between a Functional & Iterative Language. F# style..
A few months ago I had a really frustrating debate with my younger brother. He had come up to JHB to come for a visit and we decided to talk about programming. Of course I thought I would put a good pitch in for F#, but just couldn’t seem to do it any justice. Eventually his point was as follows - “What really is the difference between declaring a functional solution vs an iterative solution. Sure, in F# you have something like the function, but isn’t it just a shorthand for a for loop or ......

Posted On Tuesday, August 10, 2010 9:23 PM

F# – Euler Problem 10
So today I had the pleasure of attempting Euler Problem 10… the problem goes as follows… The Problem The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. The Solution What I enjoyed about this problem is that if you have done the previous Euler problems, then this problem is really just a focus on pure performance as the other aspects of the problem have in essence been solved before. Not that I have found an optimal solution, in fact I was very ......

Posted On Tuesday, August 10, 2010 5:03 PM

F# Visual Studio 2010 Keyboard Shortcuts


For those using VS2010 with F#, this may be a useful reference for the default keyboard shortcuts in VS.

Posted On Sunday, August 8, 2010 10:27 AM

F# – 5 Best practices (Practice 4)
“prefer active patterns over multiple when guards” In line with my previous posts on 5 best practices for F# from Daniel Mohl’s slideshow, over the last few days I have been learning about active patterns. The exact best practice is to prefer active patterns over multiple “when” guards during pattern matching and in this post I am going to try and compare the two techniques and then also explain some of the basics of active patterns and why it is called active. Now before I go any further, let me ......

Posted On Saturday, July 31, 2010 8:29 AM

F# - Euler Problem 9
Another day flown by… another Euler problem to tease me… today I attempted problem 9. The Problem A Pythagorean triplet is a set of three natural numbers, a < b < c, for which a^2 + b^2 = c^2 For example, 3^2 + 4^2 = 9 +16 = 25 = 5^2. There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc. The Solution Initially I thought I would try and tackle this problem by setting up 3DArrays in F#, thus my question on StackOverflow regarding 2D Array. However, if ......

Posted On Tuesday, July 27, 2010 5:20 PM

F# – Euler Problem 8
Today I had some more spare time to give Euler a go and thought I would try my luck on problem 8. The Problem Find the greatest product of five consecutive digits in the 1000-digit number. 731671765313306249192251196... 969835203127745063262395783... 858615607891129494954595017... 125406987471585238630507156... 668966489504452445231617318... 622298934233803081353362766... 303589072962904915604407723... ......

Posted On Saturday, July 24, 2010 8:34 AM

F# – 5 Best practices for F# (Practice 3)
In line with Daniel Mohl’s presentation, the third best practice for F# is Tail Recursive Functions. I must admit, while I did go over recursion several years ago, I never heard (or possibly ignored) any mention of tail recursive functions… so what exactly is a tail recursive function? I posed the question on Stack Overflow and got some great examples and responses… Possibly the best explanation came from a post done by Chris Smith entitled Understanding Tail Recursion. Basically, non tail recursive ......

Posted On Monday, July 19, 2010 7:37 PM

Copyright © MarkPearl | Powered by: