"~effect/interfaces/Equal"Defines the unique string identifier for the Equal interface.
When to use
Use when you implement custom equality and need the computed property key for the equality method.
Details
This is a pure constant with no allocation or side effects.
Example (Implementing Equal on a class)
import { Equal, Hash } from "effect"
class UserId implements Equal.Equal {
constructor(readonly id: string) {}
[Equal.symbol](that: Equal.Equal): boolean {
return that instanceof UserId && this.id === that.id
}
[Hash.symbol](): number {
return Hash.string(this.id)
}
}Source effect/Equal.ts:521 lines
export const const symbol: "~effect/interfaces/Equal"Defines the unique string identifier for the Equal interface.
When to use
Use when you implement custom equality and need the computed property key for
the equality method.
Details
This is a pure constant with no allocation or side effects.
Example (Implementing Equal on a class)
import { Equal, Hash } from "effect"
class UserId implements Equal.Equal {
constructor(readonly id: string) {}
[Equal.symbol](that: Equal.Equal): boolean {
return that instanceof UserId && this.id === that.id
}
[Hash.symbol](): number {
return Hash.string(this.id)
}
}
symbol = "~effect/interfaces/Equal"Referenced by 4 symbols