Skip to content

Commit

Permalink
Merge pull request #956 from edmundnoble/series/7.2.x
Browse files Browse the repository at this point in the history
Issue #870: Made Order.reverseOrder tie the knot.
  • Loading branch information
xuwei-k committed Jul 27, 2015
2 parents 72e9249 + 9ef0f25 commit c58dec3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/scala/scalaz/Order.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ trait Order[F] extends Equal[F] { self =>
def compare(x: F, y: F) = self.order(x, y).toInt
}

final def reverseOrder = new Order[F] {
def reverseOrder: Order[F] = new Order[F] {
def order(x: F, y: F): Ordering = self.order(y, x)
override def equal(x: F, y: F) = self.equal(x, y)
override def equalIsNatural = self.equalIsNatural
override def reverseOrder = self
}

trait OrderLaw extends EqualLaw {
Expand Down

0 comments on commit c58dec3

Please sign in to comment.