Eq<T> class abstract

A type class used to determine equality between 2 instances of the same type T. Any 2 instances x and y are equal if eqv(x, y) is true.

Moreover, eqv should form an equivalence relation (a binary relation that is reflexive, symmetric, and transitive).

Implementers

Constructors

Eq()
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

and(Eq<T> eq) Eq<T>
Return an Eq that gives the result of and of eq1 and eq2.
contramap<A>(T map(A)) Eq<A>
Return an Eq instance based on a parameter of type T extracted from a class A.
eqv(T x, T y) bool
Returns true if x and y are equivalent, false otherwise.
neqv(T x, T y) bool
Returns false if x and y are equivalent, true otherwise.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
or(Eq<T> eq) Eq<T>
Return an Eq that gives the result of or of this Eq and eq.
toString() String
A string representation of this object.
inherited
xor(Eq<T> eq) Eq<T>
Return an Eq that gives the result of xor of this Eq and eq.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

dateEqDay Eq<DateTime>
Eq instance to compare DateTime days.
getter/setter pair
dateEqMonth Eq<DateTime>
Eq instance to compare DateTime months.
getter/setter pair
dateEqYear Eq<DateTime>
Eq instance to compare DateTime years.
getter/setter pair
dateEqYearMonthDay Eq<DateTime>
Eq instance to compare DateTime by year, month, and day.
getter/setter pair
eqBool Eq<bool>
Instance of Eq for bool using the standard == operator.
getter/setter pair
eqDouble Eq<double>
Instance of Eq for double using the standard == operator.
getter/setter pair
eqInt Eq<int>
Instance of Eq for int using the standard == operator.
getter/setter pair
eqNum Eq<num>
Instance of Eq for num using the standard == operator.
getter/setter pair
eqString Eq<String>
Instance of Eq for String using the standard == operator.
getter/setter pair

Static Methods

allEqual<A>() Eq<A>
An Eq<A> in which everything is the same (calling eqv returns always true).
by<A, B>(B f(A a), Eq<B> eq) Eq<A>
Convert an implicit Eq<B> to an Eq<A> using the given function f.
fromUniversalEquals<A>() Eq<A>
An Eq<A> that delegates to universal equality (==).
instance<A>(bool f(A a1, A a2)) Eq<A>
Create an Eq instance from an eqv implementation.