reduce iterated values into a single value