Permutations: Difference between revisions
m
→Functional composition: updated comment line (type signature)
m (→ES6: let -> const) |
m (→Functional composition: updated comment line (type signature)) |
||
Line 2,525:
<lang JavaScript>(function () {
// permutations :: [a] -> [[a]]
function permutations(xs) {
return xs.length ? (concatMap(
Line 2,568:
["eat", "Aardvarks", "ants"], ["eat", "ants", "Aardvarks"],
["ants", "Aardvarks", "eat"], ["ants", "eat", "Aardvarks"]]</lang>
===ES6===
|