Structuring Arrays with Algebraic Shapes