Skip to content

Instantly share code, notes, and snippets.

@isaacabraham
Created December 28, 2019 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacabraham/d551242a8d974826b8ad3beafee57521 to your computer and use it in GitHub Desktop.
Save isaacabraham/d551242a8d974826b8ad3beafee57521 to your computer and use it in GitHub Desktop.
let (|Mod|_|) div value =
if value % div = 0 then Some() else None
let fizzBuzz = function
| Mod 3 & Mod 5 -> "FizzBuzz"
| Mod 3 -> "Fizz"
| Mod 5 -> "Buzz"
| n -> string n
[ 1 .. 100 ]
|> List.map fizzBuzz
|> List.iter (printfn "%s")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment