Is there a way to include the entire record field when destructuring in a pattern matching clause? Something like this:
type user = { id: string; name: string; address: string }
let find_steve = function
| { id; name }@user when id = "3" or name = "Steve" -> Some user
| _ -> None
I feel like I remember there was a way to do this in general for any kind of destructuring, but I can’t find it now. I’ve been looking for it in the Bucklescript + ReasonML docs and Real World Ocaml but no dice…