Skip to content

Commit

Permalink
in kernelJVM
Browse files Browse the repository at this point in the history
  • Loading branch information
satorg committed Apr 16, 2022
1 parent fe40bc2 commit 596d400
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions kernel/src/main/scala/cats/kernel/Eq.scala
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,16 @@ private[kernel] trait HashInstances extends HashInstances0 {
cats.kernel.instances.sortedSet.catsKernelStdHashForSortedSet[A](Hash[A])
implicit def catsKernelHashForFunction0[A: Hash]: Hash[() => A] =
cats.kernel.instances.function.catsKernelHashForFunction0[A]
implicit def catsKernelHashForMap[K: Hash, V: Hash]: Hash[Map[K, V]] =
cats.kernel.instances.map.catsKernelStdHashForMap[K, V]
implicit def catsKernelHashForMapBinCompat[K, V: Hash]: Hash[Map[K, V]] =
cats.kernel.instances.map.catsKernelStdHashForMapBinCompat[K, V]
implicit def catsKernelHashForSortedMap[K: Hash, V: Hash]: Hash[SortedMap[K, V]] =
cats.kernel.instances.sortedMap.catsKernelStdHashForSortedMap[K, V]
implicit def catsKernelHashForEither[A: Hash, B: Hash]: Hash[Either[A, B]] =
cats.kernel.instances.either.catsStdHashForEither[A, B]

@deprecated("Use catsKernelHashForMapBinCompat instead", "2.8.0")
def catsKernelHashForMap[K: Hash, V: Hash]: Hash[Map[K, V]] =
cats.kernel.instances.map.catsKernelStdHashForMapBinCompat[K, V]
}

private[kernel] trait HashInstances0 extends EqInstances {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ import compat.scalaVersionSpecific._

@suppressUnusedImportWarningForScalaVersionSpecific
trait MapInstances extends MapInstances1 {
implicit def catsKernelStdHashForMap[K: Hash, V: Hash]: Hash[Map[K, V]] =
implicit def catsKernelStdHashForMapBinCompat[K, V: Hash]: Hash[Map[K, V]] =
new MapHash[K, V]

implicit def catsKernelStdCommutativeMonoidForMap[K, V: CommutativeSemigroup]: CommutativeMonoid[Map[K, V]] =
new MapMonoid[K, V] with CommutativeMonoid[Map[K, V]]

@deprecated("Use catsKernelStdHashForMapBinCompat instead", "2.8.0")
def catsKernelStdHashForMap[K: Hash, V: Hash]: Hash[Map[K, V]] =
new MapHash[K, V]
}

private[instances] trait MapInstances1 {
Expand Down

0 comments on commit 596d400

Please sign in to comment.