type foo = A of int * int | B of (int * int)
What is the difference between int * int and (int * int) there? The only dif
This is one of the tricky things in OCaml syntax -- even though it looks like you are declaring a constructor with a tuple data type (A of int * int), and even though when you use the constructor, it looks like you are giving a tuple to it (A (2,3)), that is not actually what is happening.
If you actually construct a tuple value and try to pass it to the constructor, it will not compile -- let x = (2,3) in A x. Rather, the * in the constructor definition and the (,) in the constructor use expression are simply the syntax for a constructor of multiple arguments. The syntax imitates that of a constructor with a tuple argument, but is actually separate. The extra parentheses are necessary if you want to actually make a constructor with a single tuple argument.