summaryrefslogtreecommitdiff
path: root/sources/scala/Ord.scala
blob: aa55504c39745134f621689a322130f2c392922c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2003, LAMP/EPFL                  **
**  __\ \/ /__/ __ |/ /__/ __ |                                         **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
** $Id$
\*                                                                      */

package scala;

trait Ord[t <: Ord[t]]: t {
  def < (that: t): Boolean;
  def <=(that: t): Boolean = this < that || this == that;
  def > (that: t): Boolean = that < this;
  def >=(that: t): Boolean = that <= this;
}

/* Shall we use a covariant Ord?

trait Ord[+T <: Ord[T]] {
  def < [S >: T <: Ord[S]](that: S): Boolean;
  def <=[S >: T <: Ord[S]](that: S): Boolean = this < that || this == that;
  def > [S >: T <: Ord[S]](that: S): Boolean = that < this;
  def >=[S >: T <: Ord[S]](that: S): Boolean = that <= this;
}
*/