Power Set by Lost_dog

main=interact$h.(iterate f[]!!).read
f[]=["0"]
f(x:y)=do z<-f y;[z,x#z]
x#"0"=h[x]
x#y=h[x,init$tail y]
h x='{':drop 2(x>>=(", "++))++"}"

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page