Created
November 1, 2014 10:14
-
-
Save ShigekiKarita/6703c4fff03b27b5d4fa to your computer and use it in GitHub Desktop.
妄想
This file contains hidden or 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.algorithm | |
auto deeper(T, U)(U[T][] records, U[][] maxElems) | |
{ | |
// こういうのはこうかけるが | |
auto maxRec = records.map!values.reduce!max; | |
// こういうのはこうかくしか | |
auto nextRecords = maxElems | |
.map!( | |
es => es | |
.map!( | |
e => records | |
.filter!( | |
r => r | |
.values.any!( | |
x => x == e)))); | |
return nextRecords; | |
} | |
// こうかけると楽しい?(いや楽しくない | |
// error: "multiple ! arguments are not allowed" | |
auto deeper(T, U)(T records, U maxElems) | |
{ | |
auto nextRecords = maxElems.map!map!records.filter!values.any!equals; | |
return nextRecords; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment