RosettaCodeData/Task/Power-set/F-Sharp/power-set-1.fs

2 lines
94 B
Forth
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
let subsets xs = List.foldBack (fun x rest -> rest @ List.map (fun ys -> x::ys) rest) xs [[]]