Skip to content

Commit

Permalink
Autoderive Eq
Browse files Browse the repository at this point in the history
  • Loading branch information
mulias committed Dec 30, 2023
1 parent 2068d20 commit 39e92e8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions package/Array2D.roc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ interface Array2D exposes [
## Fixed size two dimensional array. Unlike the builtin `List` data type
## `Array2D` is fully allocated on creation, with a starting element for each
## valid index.
Array2D a := { data : List a, shape : Shape2D } implements [Eq { isEq: isEq }]
Array2D a := { data : List a, shape : Shape2D } implements [Eq]

## Return an empty array with 0 rows, 0 columns, and no elements.
empty : {} -> Array2D *
Expand Down Expand Up @@ -934,9 +934,6 @@ expect
a = fromLists [[1, 2, 3], [4, 5, 6]] FitShortest
mul a (identity 3) == Ok a

isEq : Array2D a, Array2D a -> Bool where a implements Eq
isEq = \@Array2D a, @Array2D b -> a == b

listIndexOf : Shape2D, Index2D -> Result Nat [OutOfBounds]
listIndexOf = \arrayShape, index ->
if Shape2D.hasIndex arrayShape index then
Expand Down

0 comments on commit 39e92e8

Please sign in to comment.