foldLeft

simple fold left over tuples

foldLeft
(
alias func
Accumulator
Ts...
)
(
Accumulator acc
,
Ts ts
)

Examples

depth-first map iterates by left-to-right search.

import std.conv : to;

enum t = tuple(1, 2, tuple(3, tuple(tuple(4, 5), 6), 7));
static assert(foldLeft!((a, b) => a ~ b.to!string ~ ", ")("", t) ==
              "1, 2, Tuple!(int, Tuple!(Tuple!(int, int), int), int)(3, Tuple!(Tuple!(int, int), int)(Tuple!(int, int)(4, 5), 6), 7), ");

Meta