From 2f836a7ad6bd08b2303d1cae0d3415a24c4d4e69 Mon Sep 17 00:00:00 2001 From: Kailuo Wang Date: Sun, 17 Dec 2017 20:06:39 -0500 Subject: [PATCH] address feedback --- kernel/src/main/scala/cats/kernel/PartialOrder.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/src/main/scala/cats/kernel/PartialOrder.scala b/kernel/src/main/scala/cats/kernel/PartialOrder.scala index 1a10d948e6..caa3baf535 100644 --- a/kernel/src/main/scala/cats/kernel/PartialOrder.scala +++ b/kernel/src/main/scala/cats/kernel/PartialOrder.scala @@ -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) } }