summaryrefslogtreecommitdiff
path: root/Common/Parsing.lean
diff options
context:
space:
mode:
Diffstat (limited to 'Common/Parsing.lean')
-rw-r--r--Common/Parsing.lean6
1 files changed, 6 insertions, 0 deletions
diff --git a/Common/Parsing.lean b/Common/Parsing.lean
index c811319..348db25 100644
--- a/Common/Parsing.lean
+++ b/Common/Parsing.lean
@@ -21,6 +21,12 @@ structure RectangularGrid.Coordinate (grid : RectangularGrid Element) where
x : Fin grid.width
y : Fin grid.height
+instance {grid : RectangularGrid Element} : BEq grid.Coordinate where
+ beq := λa b ↦ a.x == b.x && a.y == b.y
+
+instance {grid : RectangularGrid Element} : Hashable grid.Coordinate where
+ hash := λa ↦ Hashable.hash (a.x, a.y)
+
instance : ToString (RectangularGrid.Coordinate grid) where
toString := λx ↦ s!"x: {x.x}/{grid.width}, y : {x.y}/{grid.height}"