Template std.algorithm.iteration.fold
Implements the homonym function (also known as accumulate, compress, inject, or foldl) present in various programming
languages of functional flavor. The call fold!(fun)(range, seed)
first assigns seed to an internal variable result,
also called the accumulator. Then, for each element x in range, result = fun(result, x) gets evaluated. Finally, result is returned. The one-argument version fold!(fun)(range)
works similarly, but it uses the first element of the range as the
seed (the range must be non-empty).
						
				template fold(fun...)
				;
						
					
				Contained Functions
| Name | Description | 
|---|---|
| fold | 
Parameters
| Name | Description | 
|---|---|
| fun | the predicate function(s) to apply to the elements | 
See Also
    sum is similar to fold!((a, b) => a + b) that offers
    precise summing of floating point numbers.
    This is functionally equivalent to reduce with the argument order
    reversed, and without the need to use tuple
    for multiple seeds.
Example
immutable arr = [1, 2, 3, 4, 5];
// Sum all elements
writeln(arr