RosettaCodeData/Task/Power-set/Standard-ML/power-set.ml

2 lines
82 B
Standard ML

fun subsets xs = foldr (fn (x, rest) => rest @ map (fn ys => x::ys) rest) [[]] xs