From f116d968ecc80e88a2e74d50721a34be82d7a89a Mon Sep 17 00:00:00 2001 From: Luka Jacobowitz Date: Thu, 1 Feb 2018 11:51:32 +0100 Subject: [PATCH] Fix 2.10 as well --- core/src/main/scala/cats/data/NonEmptyMapImpl.scala | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/core/src/main/scala/cats/data/NonEmptyMapImpl.scala b/core/src/main/scala/cats/data/NonEmptyMapImpl.scala index 226d12dfeb..94fc27879e 100644 --- a/core/src/main/scala/cats/data/NonEmptyMapImpl.scala +++ b/core/src/main/scala/cats/data/NonEmptyMapImpl.scala @@ -23,12 +23,14 @@ import cats.{Always, Apply, Eval, Foldable, Functor, Later, NonEmptyTraverse, No import scala.collection.immutable._ - -object NonEmptyMapImpl extends NonEmptyMapInstances { - +private[data] trait Newtype2 { self => type Base trait Tag extends Any type Type[A, B] <: Base with Tag +} + + +object NonEmptyMapImpl extends NonEmptyMapInstances with Newtype2 { private[cats] def create[K, A](m: SortedMap[K, A]): Type[K, A] = m.asInstanceOf[Type[K, A]] @@ -265,6 +267,9 @@ private[data] sealed abstract class NonEmptyMapInstances { implicit def catsDataInstancesForNonEmptyMap[K: Order]: SemigroupK[NonEmptyMap[K, ?]] with NonEmptyTraverse[NonEmptyMap[K, ?]] = new SemigroupK[NonEmptyMap[K, ?]] with NonEmptyTraverse[NonEmptyMap[K, ?]] { + override def map[A, B](fa: NonEmptyMap[K, A])(f: A => B): NonEmptyMap[K, B] = + fa.map(f) + def combineK[A](a: NonEmptyMap[K, A], b: NonEmptyMap[K, A]): NonEmptyMap[K, A] = a ++ b @@ -317,7 +322,7 @@ private[data] sealed abstract class NonEmptyMapInstances { implicit def catsDataShowForNonEmptyMap[K: Show, A: Show]: Show[NonEmptyMap[K, A]] = Show.show[NonEmptyMap[K, A]](_.show) - implicit def catsDataBandForNonEmptyMap[K, A]: Band[NonEmptyMap[K, A]] = new Band[NonEmptyMap[K, A]] { + implicit def catsDataSemilatticeForNonEmptyMap[K, A]: Semilattice[NonEmptyMap[K, A]] = new Semilattice[NonEmptyMap[K, A]] { def combine(x: NonEmptyMap[K, A], y: NonEmptyMap[K, A]): NonEmptyMap[K, A] = x ++ y } }