Match expression
match test-expression with
| pattern1 [ when condition ] -> result-expression1
| pattern2 [ when condition ] -> result-expression2
| ...Exhaustivity
let fn x =
match x with
| Some true -> "ok"
| Some false -> "ko"
| None -> ""
| _ -> "?"
// ~ β οΈ Warning FS0026: his rule will never be matchedGuard
Guard vs OR Pattern
Pattern composition
Match function
Exhaustivity in OOP
Last updated