Reputation: 20229
What is the equivalent of the OCaml:
match x with
| 'a'..'k' -> 1
...
in F#?
(short of | 'a' | 'b' | 'c' ...
:)
Upvotes: 4
Views: 476
Reputation: 62472
You can use a match guard to add a condition:
match x with
| t when t >= 'a' && t <= 'k' -> 1
Upvotes: 6