Template std.algorithm.iteration.cumulativeFold
Similar to fold, but returns a range containing the successive reduced values.
The call cumulativeFold!(fun)(range, seed) first assigns seed to an
internal variable result, also called the accumulator.
The returned range contains the values result = fun(result, x) lazily
evaluated for each element x in range. Finally, the last element has the
same value as fold!(fun)(seed, range).
The one-argument version cumulativeFold!(fun)(range) works similarly, but
it returns the first element unchanged and uses it as seed for the next
elements.
This function is also known as
    partial_sum,
    accumulate,
    scan,
    Cumulative Sum.
						
				template cumulativeFold(fun...)
				;
						
					
				Contained Functions
| Name | Description | 
|---|---|
| cumulativeFold | No-seed version. The first element of ris used as the seed's value.
    For each functionfinfun, the corresponding seed typeSisUnqual!(typeof(f(e, e))), whereeis an element ofr:ElementType!R.
    OnceShas been determined, thenS s = e;ands = f(s, e);must
    both be legal. | 
| cumulativeFold | Seed version. The seed should be a single value if funis a single
    function. Iffunis multiple functions, thenseedshould be aTuple, with one field per function inf.
    For convenience, if the seed isconst, or has qualified fields, thencumulativeFoldwill operate on an unqualified copy. If this happens
    then the returned type will not perfectly matchS. | 
Parameters
| Name | Description | 
|---|---|
| fun | one or more functions to use as fold operation | 
Returns
The function returns a range containing the consecutive reduced values. If
    there is more than one fun, the element type will be     Tuple containing one element for each fun.
See Also
Note
In functional programming languages this is typically called scan, scanl,
    scanLeft or reductions.
Example
import stdExample
Sometimes it is very useful to compute multiple aggregates in one pass.
One advantage is that the computation is faster because the looping overhead
is shared. That's why cumulativeFold accepts multiple functions.
If two or more functions are passed, cumulativeFold returns a Tuple object with one member per passed-in function.
The number of seeds must be correspondingly increased.
import std