← ZIO Prelude docs

Equal

zio.prelude.Equal
See theEqual companion trait
object Equal extends EqualVersionSpecific

Attributes

Companion
trait
Source
Equal.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Equal.type

Members list

Value members

Concrete methods

def DoubleEqualWithEpsilon(epsilon: Double = ...): Equal[Double]

Equal instance for Double for imprecise equality with configurable tolerance.

Equal instance for Double for imprecise equality with configurable tolerance.

Attributes

Source
Equal.scala
def FloatEqualWithEpsilon(epsilon: Float = ...): Equal[Float]

Equal instance for Float for imprecise equality with configurable tolerance.

Equal instance for Float for imprecise equality with configurable tolerance.

Attributes

Source
Equal.scala
def apply[A](implicit equal: Equal[A]): Equal[A]

Summons an implicit Equal[A].

Summons an implicit Equal[A].

Attributes

Source
Equal.scala
def default[A]: Equal[A]

Constructs an Equal[A] that uses the default notion of equality embodied in the implementation of equals for values of type A.

Constructs an Equal[A] that uses the default notion of equality embodied in the implementation of equals for values of type A.

Attributes

Source
Equal.scala
def fromScala[A](implicit equiv: Equiv[A]): Equal[A]

Attributes

Source
Equal.scala
def make[A](equal: (A, A) => Boolean): Equal[A]

Constructs an Equal[A] from a function. The instance will be optimized to first compare the values for reference equality and then compare the values for value equality.

Constructs an Equal[A] from a function. The instance will be optimized to first compare the values for reference equality and then compare the values for value equality.

Attributes

Source
Equal.scala

Inherited methods

inline def derived[A](using mirror: Of[A]): Equal[A]

Attributes

Inherited from:
EqualVersionSpecific
Source
EqualVersionSpecific.scala

Concrete fields

val AnyHashOrd: Hash[Any] & Ord[Any]

Ord (and thus also Equal) instance for Any values. Note that since values of type Any contain no information, all values of type Any can be treated as equal to each other.

Ord (and thus also Equal) instance for Any values. Note that since values of type Any contain no information, all values of type Any can be treated as equal to each other.

Attributes

Source
Equal.scala

Hash (and thus also Equal) instance for Throwable values. Comparison is based on: Class, message and cause (stack trace is ignored).

Hash (and thus also Equal) instance for Throwable values. Comparison is based on: Class, message and cause (stack trace is ignored).

Note: This is intentionally not in the implicit scope, because it would allow comparing all Throwables across hierarchies defined by users, which would typically be a mistake.

Attributes

Source
Equal.scala

Implicits

Implicits

The Hash and Ord instance for BigDecimal.

The Hash and Ord instance for BigDecimal.

Attributes

Source
Equal.scala
implicit val BigIntHashOrd: Hash[BigInt] & Ord[BigInt]

The Hash and Ord instance for BigInt.

The Hash and Ord instance for BigInt.

Attributes

Source
Equal.scala
implicit val BooleanHashOrd: Hash[Boolean] & Ord[Boolean]

Hash and Ord (and thus also Equal) instance for Boolean values.

Hash and Ord (and thus also Equal) instance for Boolean values.

Attributes

Source
Equal.scala
implicit val ByteHashOrd: Hash[Byte] & Ord[Byte]

Hash and Ord (and thus also Equal) instance for Byte values.

Hash and Ord (and thus also Equal) instance for Byte values.

Attributes

Source
Equal.scala
implicit def CauseHash[A]: Hash[Cause[A]]

Hash (and thus also Equal) instance for Cause[A]. Note, that it doesn't take Hash[A] nor Equal[A] into account.

Hash (and thus also Equal) instance for Cause[A]. Note, that it doesn't take Hash[A] nor Equal[A] into account.

Attributes

Source
Equal.scala
implicit val CharHashOrd: Hash[Char] & Ord[Char]

Hash and Ord (and thus also Equal) instance for Char values.

Hash and Ord (and thus also Equal) instance for Char values.

Attributes

Source
Equal.scala
implicit def ChunkEqual[A : Equal]: Equal[Chunk[A]]

Derives an Equal[Chunk[A]] given an Equal[A].

Derives an Equal[Chunk[A]] given an Equal[A].

Attributes

Source
Equal.scala
implicit val ClassHash: Hash[Class[_]]

Hash (and thus also Equal) instance for Class values.

Hash (and thus also Equal) instance for Class values.

Attributes

Source
Equal.scala
implicit def DeriveEqual[F[_] : DeriveEqual, A : Equal]: Equal[F[A]]

Derives an Equal[F[A]] given a Derive[F, Equal] and an Equal[A].

Derives an Equal[F[A]] given a Derive[F, Equal] and an Equal[A].

Attributes

Source
Equal.scala
implicit val DoubleHashOrd: Hash[Double] & Ord[Double]

Hash and Ord (and thus also Equal) instance for Double values.

Hash and Ord (and thus also Equal) instance for Double values.

Note that to honor the contract

  • that a value is always equal to itself, comparing Double.NaN with itself will return true.

  • of a total ordering, Double.NaN will be treated as greater than any other number.

Attributes

Source
Equal.scala

Hash and Ord (and thus also Equal) instance for Scala Duration values.

Hash and Ord (and thus also Equal) instance for Scala Duration values.

Attributes

Source
Equal.scala

Hash and Ord (and thus also Equal) instance for ZIO Duration values.

Hash and Ord (and thus also Equal) instance for ZIO Duration values.

Attributes

Source
Equal.scala
implicit def EitherEqual[A : Equal, B : Equal]: Equal[Either[A, B]]

Derives an Equal[Either[A, B]] given an Equal[A] and an Equal[B].

Derives an Equal[Either[A, B]] given an Equal[A] and an Equal[B].

Attributes

Source
Equal.scala

The CommutativeBoth and IdentityBoth (and thus AssociativeBoth) instance for Equal.

The CommutativeBoth and IdentityBoth (and thus AssociativeBoth) instance for Equal.

Attributes

Source
Equal.scala

The CommutativeEither and IdentityEither (and thus AssociativeEither) instance for Equal.

The CommutativeEither and IdentityEither (and thus AssociativeEither) instance for Equal.

Attributes

Source
Equal.scala

The Contravariant instance for Equal.

The Contravariant instance for Equal.

Attributes

Source
Equal.scala
implicit def ExitEqual[E, A : Equal]: Equal[Exit[E, A]]

Derives an Equal[Exit[E, A]] given an Equal[A] and Equal[B].

Derives an Equal[Exit[E, A]] given an Equal[A] and Equal[B].

Attributes

Source
Equal.scala
implicit lazy val FiberIdHashOrd: Hash[FiberId]

Hash and (and thus also Equal) instance for FiberId values.

Hash and (and thus also Equal) instance for FiberId values.

Attributes

Source
Equal.scala
implicit val FloatHashOrd: Hash[Float] & Ord[Float]

Hash and Ord (and thus also Equal) instance for Float values.

Hash and Ord (and thus also Equal) instance for Float values.

Note that to honor the contract

  • that a value is always equal to itself, comparing Float.NaN with itself will return true.

  • of a total ordering, Float.NaN will be treated as greater than any other number.

Attributes

Source
Equal.scala
implicit val IntHashOrd: Hash[Int] & Ord[Int]

Hash and Ord (and thus also Equal) instance for Int values.

Hash and Ord (and thus also Equal) instance for Int values.

Attributes

Source
Equal.scala
implicit def ListEqual[A : Equal]: Equal[List[A]]

Derives an Equal[List[A]] given an Equal[A].

Derives an Equal[List[A]] given an Equal[A].

Attributes

Source
Equal.scala
implicit val LongHashOrd: Hash[Long] & Ord[Long]

Hash and Ord (and thus also Equal) instance for Long values.

Hash and Ord (and thus also Equal) instance for Long values.

Attributes

Source
Equal.scala
implicit def MapPartialOrd[A, B : Equal]: PartialOrd[Map[A, B]]

Derives a PartialOrd[Map[A, B]] (and thus Equal[Map[A, B]]) given an Equal[B]. Due to the limitations of Scala's Map, this uses object equality on the keys.

Derives a PartialOrd[Map[A, B]] (and thus Equal[Map[A, B]]) given an Equal[B]. Due to the limitations of Scala's Map, this uses object equality on the keys.

Attributes

Source
Equal.scala
implicit def NonEmptyChunkEqual[A : Equal]: Equal[NonEmptyChunk[A]]

Derives an Equal[NonEmptyChunk[A]] given an Equal[A].

Derives an Equal[NonEmptyChunk[A]] given an Equal[A].

Attributes

Source
Equal.scala
implicit val NothingHashOrd: Hash[Nothing] & Ord[Nothing]

Hash and Ord (and thus also Equal) instance for Nothing values. Note that since there are not values of type Nothing the equals method of this instance can never be called but it can be useful in deriving instances for more complex types.

Hash and Ord (and thus also Equal) instance for Nothing values. Note that since there are not values of type Nothing the equals method of this instance can never be called but it can be useful in deriving instances for more complex types.

Attributes

Source
Equal.scala
implicit def OptionEqual[A : Equal]: Equal[Option[A]]

Derives an Equal[Option[A]] given an Equal[A].

Derives an Equal[Option[A]] given an Equal[A].

Attributes

Source
Equal.scala
implicit def OptionalEqual[A : Equal]: Equal[Optional[A]]

Derives an Equal[Optional[A]] given an Equal[A].

Derives an Equal[Optional[A]] given an Equal[A].

Attributes

Source
Equal.scala
implicit def SetHashPartialOrd[A]: Hash[Set[A]] & PartialOrd[Set[A]]

PartialOrd and Hash (and thus also Equal) instance for Set[A] values. Due to the limitations of Scala's Set, this uses object equality and hash code on the elements.

PartialOrd and Hash (and thus also Equal) instance for Set[A] values. Due to the limitations of Scala's Set, this uses object equality and hash code on the elements.

Attributes

Source
Equal.scala
implicit val ShortHashOrd: Hash[Short] & Ord[Short]

Hash and Ord (and thus also Equal) instance for Short values.

Hash and Ord (and thus also Equal) instance for Short values.

Attributes

Source
Equal.scala
implicit val StackTraceHash: Hash[StackTrace]

Hash (and thus also Equal) instance for StackTrace values.

Hash (and thus also Equal) instance for StackTrace values.

Attributes

Source
Equal.scala
implicit val StringHashOrd: Hash[String] & Ord[String]

Hash and Ord (and thus also Equal) instance for String values.

Hash and Ord (and thus also Equal) instance for String values.

Attributes

Source
Equal.scala
implicit def TryEqual[A : Equal]: Equal[Try[A]]

Derives an Equal[Try[A]] given an Equal[A].

Derives an Equal[Try[A]] given an Equal[A].

Attributes

Source
Equal.scala
implicit def Tuple10Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal, G : Equal, H : Equal, I : Equal, J : Equal]: Equal[(A, B, C, D, E, F, G, H, I, J)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple11Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal, G : Equal, H : Equal, I : Equal, J : Equal, K : Equal]: Equal[(A, B, C, D, E, F, G, H, I, J, K)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple12Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal, G : Equal, H : Equal, I : Equal, J : Equal, K : Equal, L : Equal]: Equal[(A, B, C, D, E, F, G, H, I, J, K, L)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple13Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal, G : Equal, H : Equal, I : Equal, J : Equal, K : Equal, L : Equal, M : Equal]: Equal[(A, B, C, D, E, F, G, H, I, J, K, L, M)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple14Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal, G : Equal, H : Equal, I : Equal, J : Equal, K : Equal, L : Equal, M : Equal, N : Equal]: Equal[(A, B, C, D, E, F, G, H, I, J, K, L, M, N)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple15Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal, G : Equal, H : Equal, I : Equal, J : Equal, K : Equal, L : Equal, M : Equal, N : Equal, O : Equal]: Equal[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple16Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal, G : Equal, H : Equal, I : Equal, J : Equal, K : Equal, L : Equal, M : Equal, N : Equal, O : Equal, P : Equal]: Equal[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple17Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal, G : Equal, H : Equal, I : Equal, J : Equal, K : Equal, L : Equal, M : Equal, N : Equal, O : Equal, P : Equal, Q : Equal]: Equal[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple18Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal, G : Equal, H : Equal, I : Equal, J : Equal, K : Equal, L : Equal, M : Equal, N : Equal, O : Equal, P : Equal, Q : Equal, R : Equal]: Equal[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple19Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal, G : Equal, H : Equal, I : Equal, J : Equal, K : Equal, L : Equal, M : Equal, N : Equal, O : Equal, P : Equal, Q : Equal, R : Equal, S : Equal]: Equal[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple20Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal, G : Equal, H : Equal, I : Equal, J : Equal, K : Equal, L : Equal, M : Equal, N : Equal, O : Equal, P : Equal, Q : Equal, R : Equal, S : Equal, T : Equal]: Equal[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple21Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal, G : Equal, H : Equal, I : Equal, J : Equal, K : Equal, L : Equal, M : Equal, N : Equal, O : Equal, P : Equal, Q : Equal, R : Equal, S : Equal, T : Equal, U : Equal]: Equal[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple22Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal, G : Equal, H : Equal, I : Equal, J : Equal, K : Equal, L : Equal, M : Equal, N : Equal, O : Equal, P : Equal, Q : Equal, R : Equal, S : Equal, T : Equal, U : Equal, V : Equal]: Equal[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple2Equal[A : Equal, B : Equal]: Equal[(A, B)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple3Equal[A : Equal, B : Equal, C : Equal]: Equal[(A, B, C)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple4Equal[A : Equal, B : Equal, C : Equal, D : Equal]: Equal[(A, B, C, D)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple5Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal]: Equal[(A, B, C, D, E)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple6Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal]: Equal[(A, B, C, D, E, F)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple7Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal, G : Equal]: Equal[(A, B, C, D, E, F, G)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple8Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal, G : Equal, H : Equal]: Equal[(A, B, C, D, E, F, G, H)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit def Tuple9Equal[A : Equal, B : Equal, C : Equal, D : Equal, E : Equal, F : Equal, G : Equal, H : Equal, I : Equal]: Equal[(A, B, C, D, E, F, G, H, I)]

Derives an Equal for a product type given an Equal for each element of the product type.

Derives an Equal for a product type given an Equal for each element of the product type.

Attributes

Source
Equal.scala
implicit val UnitHashOrd: Hash[Unit] & Ord[Unit]

Hash and Ord (and thus also Equal) instance for Unit values. Since there is only one Unit value all equality comparisons will always be true.

Hash and Ord (and thus also Equal) instance for Unit values. Since there is only one Unit value all equality comparisons will always be true.

Attributes

Source
Equal.scala
implicit def VectorEqual[A : Equal]: Equal[Vector[A]]

Derives an Equal[Vector[A]] given an Equal[A].

Derives an Equal[Vector[A]] given an Equal[A].

Attributes

Source
Equal.scala