Skip to content

Commit

Permalink
Fix 2.10 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Luka Jacobowitz committed Feb 1, 2018
1 parent 7525ca8 commit f116d96
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions core/src/main/scala/cats/data/NonEmptyMapImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit f116d96

Please sign in to comment.