Question: Generate all partitions of a set

Hello,

Is there a Maple procedure that generates all possible partitions of a given set? For example, for the set {1,2,3} it should give {1,2,3}, {1,{2,3}}, {2,{1,3}}, {3,{1,2}}, {{1,2,3}}.

If not, how could I write one?

Thank you!

Please Wait...