open System
let random_number_generator = System.Random(int System.DateTime.Now.Ticks) in
let random_number_below n = random_number_generator.Next(n) in
match random_number_below 3 with
| 0 -> "Zero!"
| 1 -> "One!"
| 2 -> "Two!"
;;
根据编译器,上述匹配语句并非详尽无遗。这是完全合法的,因为F#没有可以保证随机数界限的语法信息。
Incomplete pattern matches on this expression. For example, the value '3' may indicate a case not covered by the pattern(s).
与随机数匹配的惯用F#方式(或者只是if-else')是什么?