Use NonEmpty
and separate EmptyGrid
constructor for Grid
#1843
Labels
Z-Refactoring
This issue is about restructuring the code without changing the behaviour to improve code quality.
With a grid definition like
newtype Grid = Grid [[a]]
, there is more than one way to represent an "empty grid":Grid []
Grid [[]]
Grid [[], [], [], [], [], ...]
If instead we use
NonEmpty
for both rows and columns, then there can be exactly one "normalized" representation for an empty grid:The text was updated successfully, but these errors were encountered: