You need to use
type a' = A' of (int * int)
This is one of the tricky places in OCaml type specification.
There are two different types involved that are subtly different:
type one_field = F1 of (int * int)
type two_fields = F2 of int * int
In the type one_field
there's a single field that's a pair of ints. In the type two_fields
there are two fields each of which is an int. The tricky thing is that the constructor looks identical:
# F1 (3, 5);;
- : one_field = F1 (3, 5)
# F2 (3, 5);;
- : two_fields = F2 (3, 5)
These two types are distinct, and are in fact represented differently in memory. (The two-field variant actually takes less space and is slightly faster to access.)