Generic Set Product implemented in Swift