lazy ndslice composed of fun(a_n, a_n+1) values.
import mir.ndslice.slice: sliced; assert([2, 4, 3, -1].sliced.pairwise!"a + b" == [6, 7, 2]);
N-dimensional
// performs pairwise along each dimension // 0 1 2 3 // 4 5 6 7 // 8 9 10 11 assert([3, 4].iota.pairwise!"a + b" == [[10, 14, 18], [26, 30, 34]]);
Pairwise map for tensors.
The computation is performed on request, when the element is accessed.