Converts a set or algebraic structure to an array.