All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cats.syntax.hash.scala Maven / Gradle / Ivy

The newest version!
package cats
package syntax

trait HashSyntax {

  implicit def catsSyntaxHash[A: Hash](a: A): HashOps[A] =
    new HashOps[A](a)

}

final class HashOps[A: Hash](a: A) {

  /**
   * Gets the hash code of this object given an implicit `Hash` instance.
   */
  def hash: Int = Hash[A].hash(a)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy