I'm trying to write a function "dom_rank r1 r2" that returns a boolean depending on the relative ranks of two playing Cards (rank is a type I defined, it has values "Six", "Seven", "Eight" ..... "King", "Ace"). If r1 is a King and r2 is a Jack, r1 is greater than r2 and the function returns true, and if r1 is Six and r2 is Ten then the function returns false. I understand that I could list out every possibility of two card inputs (I'm only dealing with cards Six-Ace, that makes about 30 different possibilities) but I'm trying to write simpler code. The method looks something like:
let dom_rank r1 r2 = match r1, r2 with
| Ace, _ -> true
| King, (Queen || Jack || Ten ........) -> true
I'm getting a syntax error at the beginning of the boolean expression "(Queen || Jack || Ten ........)". Why can't I list several possibilities for r2 in this way? Is there a way to write this expression in Ocaml?