Disjoint union types are equivalent if their corresponding component types are equivalent. Recursive types are a problem. Type Names Question becomes more interesting because of type names . E.g., As a way of improving program correctness by subdividing values into types according to their meaning within the program . For this to be useful, some structurally equivalent types must be treated as inequivalent .
Most languages use mixed solutions.
C Type Equivalence C uses structural equivalence for array and function types, but name equivalence for struct , union , and enum types. Note this policy makes it easy to check equivalence of recursiive types, which can only be built using struct s. ML Type Equivalence ML uses structural equivalence, except that each datatype declaration creates a new type unlike all others. Note that the mandatory use of constructors makes it possible to uniquely identify the types of literals.