Flatmaps a range
Flatmaps a range of elemenents
1 auto dup(int n) { 2 return [n, n]; 3 } 4 5 assert([1, 2].flatMap!dup.equal([1, 1, 2, 2])); 6 7 import optional: some, no; 8 9 assert([ 10 no!int, 11 some(3), 12 no!int, 13 some(7), 14 ].flatMap!"a".equal( 15 [3, 7] 16 ));
See Source File
Flatmaps a range