Pattern match on records with option type entries in OCaml
问题 basically I have defined a record type like this: and exp = Bil_t.exp = { var: var option; binop: binop option; load: load option; store: store option; cast: cast option; inte: inte option; let_exp: let_exp option } And I am thinking to use a pattern match to process it, something like this: match rexp with | {None;binop;None;None;None;None;None} -> trans_binop @@ strip binop | {var;None;None;None;None;None;None} -> BU.inte_to_string @@ strip @@ mark inte | _ -> failwith "undefined" Sorry for