Map over a generator function