lazy:reduce the interface of predicate takes number of elements and accumulator