mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Compile derived structural equality
This commit is contained in:
parent
54e977be2d
commit
3674f6861e
7 changed files with 41 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue