Like reduce, reduceWhile returns a single item by iterating
through the list, successively calling the iterator function. reduceWhile
also takes a predicate that is evaluated before each step. If the predicate
returns false, it "short-circuits" the iteration and returns the current
value of the accumulator.