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

Fix constraints and names for new Foldable methods #3122

Merged
merged 3 commits into from
Oct 28, 2019

Conversation

travisbrown
Copy link
Contributor

This is a follow-up for #3084, with three changes, two of which should be uncontroversial:

  • These are methods on the Foldable and Reducible type classes, and shouldn't have Foldable or Reducible constraints, so I've removed them.
  • I fixed the references in the first @see clauses in the API docs for the Foldable methods (they should point to the *By methods on Reducible).

I've also changed the method names from minimumOptionBy and maximumOptionBy to minimumByOption and maximumByOption. This is consistent with the standard library's maxByOption, and also with e.g. reduceRightOption (from both the standard library and Cats).

Following the standard library here seems like the right thing to do, and these new methods haven't been in a release yet, so we don't need to worry about compatibility. If people would prefer to keep the OptionBy versions I can remove that commit, though.

/cc @joroKr21

Copy link
Member

@LukaJCB LukaJCB left a comment

Choose a reason for hiding this comment

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

Good catch 👍

Copy link
Contributor

@kailuowang kailuowang left a comment

Choose a reason for hiding this comment

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

Thanks!

@codecov-io
Copy link

codecov-io commented Oct 28, 2019

Codecov Report

Merging #3122 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3122   +/-   ##
=======================================
  Coverage   93.17%   93.17%           
=======================================
  Files         372      372           
  Lines        7182     7182           
  Branches      198      198           
=======================================
  Hits         6692     6692           
  Misses        490      490
Flag Coverage Δ
#scala_version_212 93.52% <100%> (+0.02%) ⬆️
#scala_version_213 90.85% <100%> (+0.01%) ⬆️
Impacted Files Coverage Δ
core/src/main/scala/cats/Foldable.scala 100% <100%> (ø) ⬆️
core/src/main/scala/cats/Reducible.scala 100% <100%> (ø) ⬆️

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 34e7c43...377b0a5. Read the comment docs.

@joroKr21
Copy link
Member

joroKr21 commented Oct 28, 2019

Ohh, I think I see what happened here. Initially added them as bincompat syntax I think, then realized we can have them in the typeclasses after dropping 2.11, but I completely forgot to remove the constraints.

I wonder if -Ywarn-unused:params would've helped here.
No it wouldn't they were actually used 😞

Regardless, thank you @travisbrown!

I'm ok with the name change as well.

Copy link
Member

@joroKr21 joroKr21 left a comment

Choose a reason for hiding this comment

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

Thank you!

@kailuowang kailuowang merged commit 007155f into typelevel:master Oct 28, 2019
@travisbrown
Copy link
Contributor Author

@joroKr21 Ah, that makes sense!

@travisbrown travisbrown added this to the 2.1.0-RC1 milestone Nov 5, 2019
@travisbrown travisbrown changed the title Follow-up #3084 Fix constraints and names for new Foldable methods Nov 14, 2019
gagandeepkalra added a commit to gagandeepkalra/cats that referenced this pull request Feb 16, 2020
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