At least, is it a way to write the last case of the match like: | BddNode vy , BddNode vx -> compare vx vy
(with this exact syntax, the compiler complains that the BddNode constructor ask for 3 parameters)
The way you have defined it, the constructor BddNode expects 3 arguments. They cannot be collected into a tuple vx in the way you tried above. You could define another constructor BddNode1 of (string * int *int) which is a one-argument constructor that takes a tuple (note the parentheses). With that you could do the match as you wanted. Unfortunately, OCaml prints values of BddNode and BddNode1 in the exact same way. Afair there are differences in the representation of values of these types in memory but i can never remember the details.