I'm having a hard time coming up with an algorithm for generating a list of all possible sets of sets of a set. By that I mean, given a set S I would like to know all possible sets containing sets of the set S. I probably didn't describe it too well so I'll give an example that will hopefully get the point across.

If S = `{1, 2, 3}`

I'm looking for:

> 
> {{1, 2, 3}}
> 
> 
> {{1, 2}, {3}}
> 
> 
> {{1, 3}, {2}}
> 
> 
> {{2, 3}, {1}}
> 
> 
> {{1}, {2}, {3}}
> 
> 
> 

While tedious I can generate these by hand but I'm having a hard time coming up with an algorithm I can put to code.