Implement Ruby-like pseudo-method `map`