aboutsummaryrefslogtreecommitdiff
path: root/src/scala/Eq.scala
blob: 697ec4318272a8551eaac8cd5130d5d499dd074d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package scala

/** A marker class indicating that values of kind `T` can be compared. */
class Eq[-L, -R]

/** Besides being a companion object, this object
 *  can also be used as a value that's compatible with
 *  any instance of `Eq`.
 */
object Eq extends Eq[Any, Any] {

  /** An implicit that provides an `Eq` instance for all types `T`
   *  such that `T <: EqClass[T]`.
   */
  implicit def eqAny[L, R]: Eq[L, R] = Eq
}