concept reduce function in category clojure

This is an excerpt from Manning's book Clojure: The Essential Reference.
Let’s now have a look at an example involving
reductions.reductionsis designed to keep track of each evaluation of the reducing function over time. This aspect could be useful in showing time series, like a "moving average". This technique is well known in finance, where it’s used to eliminate local outliers and highlight trends [81]. The following example calculates the average for each incoming value of a stock price (but there are other possibilities like batching up all values for a day that we are not considering there to remove some complexity):
In its simplest form,
foldtakes a reducing function (a function supporting at least 2 arguments) and a collection. If the input collection supports parallel folding (currently vectors, maps and foldcat objects), it splits the input collection into chunks of roughly the same size and executes the reducing function on each partition in parallel (and on multiple CPU cores when possible). It then combines the results back into a single output:
completingprovides (or replace) the single arity call in a reducing function. This is useful when working with transduce:(transduce (map inc) - 0 (range 10)) ; #1 ;; 55 (transduce (map inc) (completing -) 0 (range 10)) ; #2 ;; -55There are three possible problems related to the single arity call that can arise using a reducing function with
transduce:The single arity version of the reducing function is generating unwanted changes. This is the case we’ve seen in the previous example.
The single arity version of the reducing function is non existent. In this case we want to provide one to avoid exceptions.