match case unused
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <[email protected]> |
I have to rewrite a not function with pattern matching.
So I did this :
let not x =
match x with
x -> false
| _ -> true ;;
but now I see this warning : Warning 11: this match case is unused.
Which is correct because on output both not true and not false gives the output true.
Which I find wierd.
not true
match true with
true -> false
So the expected output is false
Can someone explain to me where my thinking took the wrong turn ?
Roelof