Associativity of the generic representation of sum types