Equality for composite types