How do I compare x and y in F#?
I need help with the matching pattern that would compare 2 numbers.
Something like that:
let test x y =
match x with
| y when x < y -> printfn "less than"
| y when x > y -> printfn "greater than"
| _ -> printfn "equal"
Somehow it falls to the "_" case when x is 0 and y is 200. What am I doing
wrong here?
No comments:
Post a Comment