Skip to content

Instantly share code, notes, and snippets.

@vgaltes
Last active August 29, 2015 14:20
Show Gist options
  • Save vgaltes/ac693fc6a81885d7eed8 to your computer and use it in GitHub Desktop.
Save vgaltes/ac693fc6a81885d7eed8 to your computer and use it in GitHub Desktop.
FSharp Pattern Matching - Active recognizer
let (|Fizz|Buzz|FizzBuzz|Other|) input =
match (input % 3, input % 5) with
| 0,0 -> FizzBuzz
| 0,_ -> Fizz
| _,0 -> Buzz
| _,_ -> Other input
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment