Type equivalence in MPD is based on structural equivalence. An object can be assigned to another object if they have the same structure.
Consider the following:
type r1 = rec(int a; real b) type r2 = r1 type r3 = rec(int c; real d) type r4 = rec(real c; int d) type prim_color = enum(red, blue, yellow) type machine_name = enum(ivy, holly, thyme) type books = enum(dictionary, thesaurus) |
Obviously r1 and r2 are equivalent, but so are also r1 and r3 and thus r2 and r3. Because of the reversed order of the fields of r4 it is not equivalent to any of the other types. The enumeration prim_color is equivalent to machine_name but neither is equivalent to books.