LowPriorityOrderingImplicits

scala.math.LowPriorityOrderingImplicits

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Ordering

Members list

Type members

Types

type AsComparable[A] = A => Comparable[_ >: A]

Implicits

Implicits

implicit def comparatorToOrdering[A](implicit cmp: Comparator[A]): Ordering[A]
implicit def ordered[A](implicit asComparable: A => Comparable[_ >: A]): Ordering[A]

This would conflict with all the nice implicit Orderings available, but thanks to the magic of prioritized implicits via subclassing we can make Ordered[A] => Ordering[A] only turn up if nothing else works. Since Ordered[A] extends Comparable[A] anyway, we can throw in some Java interop too.

This would conflict with all the nice implicit Orderings available, but thanks to the magic of prioritized implicits via subclassing we can make Ordered[A] => Ordering[A] only turn up if nothing else works. Since Ordered[A] extends Comparable[A] anyway, we can throw in some Java interop too.

Attributes