Created
November 21, 2011 14:24
-
-
Save davidgrenier/1382757 to your computer and use it in GitHub Desktop.
NegativePositiveZero
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 (|Negative|Positive|Zero|) x = | |
| if x > 0 then Positive | |
| else if x < 0 then Negative | |
| else Zero | |
| let count = -2;; | |
| match count with | |
| | Zero | Negative -> printfn "Zero or less" | |
| | Positive -> printfn "Greater than zero" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment