Created
December 11, 2016 17:25
-
-
Save Marenz/ee7cbf3c6afed699aa51032e9232b715 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio; | |
import std.range; | |
import std.algorithm; | |
import std.traits; | |
void main () | |
{ | |
auto data = [[1,2], [3,4], [5], [6]]; | |
auto a = data.filter!(a=>a.length > 1); | |
auto b = data.filter!(a=>a.length == 1).map!(a=>a[0]); | |
writefln("%s ", a); | |
writefln("%s %s", only(b), b); | |
writefln("%s ", chain(a, only(b))); // error | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment