Intermediate step: refactor for_each_n to use pure tag dispatching