Implement each using yield for cartesian product