reduce yielded values into a single value