Compile derived structural equality

This commit is contained in:
Ayaz Hafiz 2022-10-05 17:17:35 -05:00
parent 54e977be2d
commit 3674f6861e
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
7 changed files with 41 additions and 1 deletions

View file

@ -3,6 +3,7 @@ interface Eq
Eq,
isEq,
isNotEq,
structuralEq,
]
imports [
Bool,
@ -37,3 +38,7 @@ Eq has
## `a != b` is shorthand for `Eq.isNotEq a b`.
isNotEq : a, a -> Bool | a has Eq
isNotEq = \a, b -> Bool.not (isEq a b)
# INTERNAL COMPILER USE ONLY: used to lower calls to `isEq` to structural
# equality via the `Eq` low-level for derived types.
structuralEq : a, a -> Bool