Question: how to easily flatten a nested set?

I can't final an equivalent to Mathematica's Flatten for sets. I know Maple has ListTools:-Flatten for lists.   

For example, given set r:={a,{b,c},d,{e,f,{g,h}}}; How to convert it to  {a,b,c,d,e,f,g,h}; 

does one have to convert each set and all the inner sets to lists, then apply ListTools:-Flatten to the result? How to map convert(z,list) for all levels?


does not work, since it only maps at top level, giving {[a], [d], [b, c], [e, f, {g, h}]}

So doing


Gives [a, d, b, c, e, f, {g, h}] 



Please Wait...