I am new to OCaml. I am trying to look for a way to check the equality of constructor types (union types ?) in the pattern matching.
type team = BRAZIL | KOREA;;
type tourn = LEAF of team | NODE of tourn * tourn ;;
let iter t d =
match t with
NODE ( (LEAF k), (LEAF i) ) when k = d -> "Yes"
| _ -> "No"
;;
iter (NODE ( (LEAF KOREA), (LEAF BRAZIL) ) KOREA (* returns "No" *)