RosettaCodeData/Task/Power-set/FunL/power-set-2.funl
2023-07-01 13:44:08 -04:00

5 lines
119 B
Text

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