You could pattern-match against multiple arguments of a function by creating a tuple and then destructuring it in a match expression:
let f x y =
match x, y with
| pattern1 -> expr1
| ...
Alternatively, if you don't need a curried function, you could do this by making f
take a tuple as the only argument:
let f (x, y) = function
| pattern1 -> expr1
| ...
The advantage of the latter method is that you don't have to write the arguments twice every time you define a function. But functions that take a tuple seems to be not as popular than curried ones.
So which of the two is deemed canonical, or preferred, in the OCaml community?
EDIT: Just as pad pointed out below, I mean let f = function blah blah
in the second code snippet.