Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
kailuowang committed Dec 18, 2017
1 parent 7c0b90d commit 2f836a7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kernel/src/main/scala/cats/kernel/PartialOrder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ object PartialOrder extends PartialOrderFunctions[PartialOrder] with PartialOrde
def partialCompare(x: A, y: A) = f(x, y)
}

def fromPartialOrdering[A](implicit ev: PartialOrdering[A]): PartialOrder[A] = from[A] { (a, b) =>
ev.tryCompare(a, b).fold(Double.NaN)(_.toDouble)
def fromPartialOrdering[A](implicit ev: PartialOrdering[A]): PartialOrder[A] = new PartialOrder[A] {
def partialCompare(x: A, y: A): Double =
ev.tryCompare(x, y).fold(Double.NaN)(_.toDouble)
}
}

Expand Down

0 comments on commit 2f836a7

Please sign in to comment.