Attributes
Members list
Value members
Concrete methods
Derives an Eq instance for type A (case class, enum, or sealed trait)
Derives an Eq instance for type A (case class, enum, or sealed trait)
Attributes
Asserts that f implements structural equality for A and wraps it as an Eq[A].
Asserts that f implements structural equality for A and wraps it as an Eq[A].
This is the only way (besides derived) to introduce an Eq instance usable in on-chain code: the compiler plugin rejects bare lambdas because on-chain === and Eq-based operations are always lowered to structural comparison of the runtime representation — a non-structural f would be silently ignored there. By wrapping f you assert that f(a, b) iff a and b are structurally equal (a.toData == b.toData); the compiler is free to replace it with an equivalent representation-optimal comparison.
Attributes
Givens
Givens
Extensions
Extensions
Conjunction of two Eq instances. Produces a potentially non-structural instance, so not available in on-chain code: on-chain equality is always structural (see Eq).
Conjunction of two Eq instances. Produces a potentially non-structural instance, so not available in on-chain code: on-chain equality is always structural (see Eq).
Attributes
Refine equality by a projection. Produces a potentially non-structural instance, so not available in on-chain code: on-chain equality is always structural (see Eq).
Refine equality by a projection. Produces a potentially non-structural instance, so not available in on-chain code: on-chain equality is always structural (see Eq).