RosettaCodeData/Task/Power-set/FunL/power-set-2.funl
2016-12-05 23:44:36 +01:00

5 lines
119 B
Text

def
powerset( {} ) = {{}}
powerset( s ) =
acc = powerset( s.tail() )
acc + map( x -> {s.head()} + x, acc )