RosettaCodeData/Task/Power-set/OCaml/power-set-2.ocaml
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

1 line
96 B
Text

let subsets xs = List.fold_right (fun x rest -> rest @ List.map (fun ys -> x::ys) rest) xs [[]]