Type Constraints for Data Constructors

So we know how to use a type parameter to statically constrain the length of a list.  Let’s continue our exploration of type constraints and see if we can figure out how to constrain the return type of a data constructor.

Pattern Matching for Dummies

The pattern matching syntax of F# will change the way you write code.  Of all the reasons to begin the move from VB to F#, the declarative style of pattern matching is reason number one.  The days of the “nested if” are numbered and blood pressures [...]

A Prime Number Generator in Visual Basic

To generate a list of Fibonacci numbers, we created a generator class that emulates the behavior of the c# yield statement.  We’ll expand on this generator in another blog to enable us to write LINQ methods, but for right now we’ll use if for a similar task, generate a list or primes.

Simulate the Yield Statement in Visual Basic Part 1

When working through the project euler problems in visual basic we very quickly run into a limitation of the language, visual basic does not support iterators.  Unfortunately, iterators probably won’t make it into the next version of vb either.  So time to get our hands dirty and roll our own iterator support.

The Great VB vs F# Euler Shootout Problem 1

I’ve been looking for some little programs to work on in order to learn F#.  Thankfully, I stumbled across Dustin Campbell’s blog, which led me to following site.

http://projecteuler.net

It’s really a lot of fun and a great way to learn F#.  Dustin has been showing the solutions in F# and [...]

F# Elegance for the VB Proletariat Part 3

Last time we discovered 3 things about writing a map function in Visual Basic.

·         The code is way longer.

F# Elegance for the VB Proletariat Part 2

A great way to learn something new is to map it to something that is already familiar.  Often times mapping the new concept to what you already know forces you to reexamine the way you are doing something.

In part 1 we built ourselves a handy recursive map function using F#.  [...]