I'm having a hard time trying to achieve the following: I have a list (say, [a,b,c,d]) and I need to partition it into pairs and unique elements in every possible way (order is not important), i.e.:
[a,b,c,d], [(a,b), c,d], [(a,b), (c,d)], [a, (b,c), d], [(a,d), (b, c)]...
and so on. This thread solves the problem when only pairs are used, but I need also the unique elements and I cannot get it to do it. Any idea will be much appreciated. Thanks!