Closed plaidfinch closed 10 years ago
This issue was solved several iterations back by the representation shift to an unindexed Compose type (now Nested, for other reasons) and an Indexed wrapper. It is now impossible to create problems like this. :)
Consider multidimensional spreadsheets. This applies to all higher-dimensional spreadsheets, but we'll examine Z2 here.
We have the following type for two-dimensional zippers:
As such, the column (
c
) index of each innerZ1 c a
is independent. This means that we can do the following:This enables us to break an expected invariant of movement in spreadsheets:
Proposed solution:
Use a new non-indexed list zipper type, and have
Z1
,Z2
, etc. defined in terms of the product of an n-tuple with an n-nested unindexed zipper. This means that there will be a single canonical value for each dimension's index, which means that it will be impossible to break this kind of invariant. This will require significant refactoring, but seems doable.