RosettaCodeData/Task/Power-set/FunL/power-set-2.funl

6 lines
119 B
Text
Raw Permalink Normal View History

2016-12-05 23:44:36 +01:00
def
powerset( {} ) = {{}}
powerset( s ) =
acc = powerset( s.tail() )
acc + map( x -> {s.head()} + x, acc )