Generator friendly version of `tap`