so far I can't figure out a way to write powerset in SML :(.
I see a pattern for example
powerset([1,2,3]) is
[] [1]
[2] [1,3]
[3] [1,2]
[2,3] [1,2,3]
Here's what I have come up with:
fun add(a,L)= [a]@L
fun ps(L)=
ps(tl L)@add(hd L, ps(tl L));
Any help appreciated.