Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Hash instance for NonEmptySet. #2981

Merged

Conversation

takayahilton
Copy link
Contributor

No description provided.

@codecov-io
Copy link

codecov-io commented Aug 9, 2019

Codecov Report

Merging #2981 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2981      +/-   ##
==========================================
+ Coverage   93.83%   93.83%   +<.01%     
==========================================
  Files         369      369              
  Lines        7068     7069       +1     
  Branches      187      193       +6     
==========================================
+ Hits         6632     6633       +1     
  Misses        436      436
Impacted Files Coverage Δ
core/src/main/scala/cats/data/NonEmptySet.scala 97.64% <100%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 803f61c...d1e1ac2. Read the comment docs.

implicit def catsDataEqForNonEmptySet[A](implicit A: Order[A]): Eq[NonEmptySet[A]] = new NonEmptySetEq[A] {
implicit override def A0: Eq[A] = A
}
}

sealed abstract private[data] class NonEmptySetInstances1 {
implicit def catsDataHashForNonEmptySet[A: Order: Hash]: Hash[NonEmptySet[A]] =
Hash[SortedSet[A]].asInstanceOf[Hash[NonEmptySet[A]]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hash inherits Eq and thus should swap positions with it.

@kailuowang kailuowang merged commit e50c00b into typelevel:master Aug 9, 2019
@takayahilton takayahilton deleted the add-hash-instance-for-NonEmptySet branch August 10, 2019 01:28
@travisbrown travisbrown added this to the 2.0-RC2 milestone Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants