Created
May 10, 2015 13:47
-
-
Save vgaltes/ea700e4c7f2334223d0a to your computer and use it in GitHub Desktop.
FSharp Pattern Matching
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let (|Even|Odd|) input = if input % 2 = 0 then Even else Odd | |
let TestNumber input = | |
match input with | |
| Even -> printfn "%d is even" input | |
| Odd -> printfn "%d is odd" input |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment