Created
November 9, 2018 21:36
-
-
Save emiflake/d6b5576030430ed9dea8f1c0c36cae82 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
function concat_map(array $arr, callable $f): array { | |
return array_reduce(array_map(function($k, $v) use ($f) { | |
return $f($k, $v); | |
}, array_keys($arr), $arr), function($acc, $v) { | |
return array_merge($acc, $v); | |
}, []); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment