The Functional FizzBuzz Kata I run a coding dojo at work. For one session I'm to showing that you can use a kata to get into a new language. 

I'm using the FizzBuzz Kata to to show F# (and JavaScript) because it is short.  The problem is I am very new to F# and find myself devolving to objects instead of being functional.

Thus, I would like to see better ways of doing this (using nunit):

namespace FizzBuzzFSharp
    open NUnit.Framework

    module FizzBuzzer = 
        let FizzBuzz number = 
            match number with 
            | i when i % 3 = 0 &amp;&amp; i % 5 = 0 -&gt; "FizzBuzz"
            | i when i % 5 = 0 -&gt; "Buzz"
            | i when i % 3 = 0 -&gt; "Fizz"
            | _ -&gt; number.ToString()


        [&lt;Test&gt;]
        [&lt;TestCase(1, "1")&gt;]
        [&lt;TestCase(2, "2")&gt;]
        [&lt;TestCase(3, "Fizz")&gt;]        
        [&lt;TestCase(4, "4")&gt;]
        [&lt;TestCase(5, "Buzz")&gt;]
        [&lt;TestCase(6, "Fizz")&gt;]
        [&lt;TestCase(7, "7")&gt;]
        [&lt;TestCase(8, "8")&gt;]
        [&lt;TestCase(9, "Fizz")&gt;]
        [&lt;TestCase(10, "Buzz")&gt;]
        [&lt;TestCase(11, "11")&gt;]
        [&lt;TestCase(12, "Fizz")&gt;]
        [&lt;TestCase(13, "13")&gt;]        
        [&lt;TestCase(14, "14")&gt;]
        [&lt;TestCase(15, "FizzBuzz")&gt;]        
        [&lt;TestCase(30, "FizzBuzz")&gt;]
        let WhenNumber_ThenResult(number, expected) = 
            Assert.AreEqual(expected, FizzBuzz(number));
I think your implementation is fine. I might write it like this, because I find it more idiomatic in F# to avoid guards (when clauses) in pattern matching where a guard free implementation is equally concise.

let fizzbuzz x = 
    match (x % 5, x % 3) with
    | (0, 0) -&gt; "FizzBuzz"
    | (0, _) -&gt; "Buzz"
    | (_, 0) -&gt; "Fizz"
    | _ -&gt; string x

[1..100] |&gt; List.map fizzbuzz |&gt; List.iter (printfn "%s")


There are ways you can make this more elaborate / extensible but while that can be an interesting exercise I don't think they're really an improvement over a simple straightforward implementation like this.