How do I get
collect(ap)
5-element Array{Partition{Int64},1}:
Set(Set{Int64}[Set([3]), Set([2]), Set([1])])
Set(Set{Int64}[Set([3]), Set([2, 1])])
Set(Set{Int64}[Set([3, 1]), Set([2])])
Set(Set{Int64}[Set([2, 3, 1])])
Set(Set{Int64}[Set([2, 3]), Set([1])])
into an array like this:
[
[[3],[2],[1]],
[[3],[2,1]],
[[3,1],[2]],
[[2,3,1]],
[[2,3],[1]]
]
In Python I can do:
In [1]: from ps1_partition import get_partitions
In [2]: ap = get_partitions([1,2,3])
In [3]: l = []
In [4]: for i in ap:
...: print(i)
...: l.append(i)
...:
[[1, 2, 3]]
[[2, 3], [1]]
[[1, 3], [2]]
[[3], [1, 2]]
[[3], [2], [1]]
In [5]: l
Out[5]: [[[1, 2, 3]], [[2, 3], [1]], [[1, 3], [2]], [[3], [1, 2]], [[3], [2], [1]]]