RosettaCodeData/Task/Permutations/Erlang/permutations-2.erl

2 lines
99 B
Erlang
Raw Permalink Normal View History

2013-04-10 23:57:08 -07:00
F = fun(L) -> G = fun(_, []) -> [[]]; (F, L) -> [[X|Y] || X<-L, Y<-F(F, L--[X])] end, G(G, L) end.