Skip to content

Fix foldA, reduceA, and reduceMapA short-circuiting#3199

Merged
LukaJCB merged 5 commits into
typelevel:masterfrom
travisbrown:topic/short-circuiting
Dec 10, 2019
Merged

Fix foldA, reduceA, and reduceMapA short-circuiting#3199
LukaJCB merged 5 commits into
typelevel:masterfrom
travisbrown:topic/short-circuiting

Conversation

@travisbrown
Copy link
Copy Markdown
Contributor

As discussed in #3150, the only real reason I can see for foldA and reduceA to exist is because they can short-circuit, while fold(fga)(Applicative.monoid) etc. can't. This change fixes them so they actually do short-circuit, and adds some tests to verify this.

@travisbrown travisbrown requested a review from LukaJCB December 10, 2019 17:04
LukaJCB
LukaJCB previously approved these changes Dec 10, 2019
@travisbrown
Copy link
Copy Markdown
Contributor Author

I went ahead and added the API docs edits in this PR, hope you don't mind, @LukaJCB.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Dec 10, 2019

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3199   +/-   ##
=======================================
  Coverage   93.06%   93.06%           
=======================================
  Files         376      376           
  Lines        7409     7409           
  Branches      197      191    -6     
=======================================
  Hits         6895     6895           
  Misses        514      514
Flag Coverage Δ
#scala_version_212 93.39% <100%> (ø) ⬆️
#scala_version_213 92.83% <100%> (ø) ⬆️
Impacted Files Coverage Δ
core/src/main/scala/cats/Foldable.scala 98.5% <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 1d9ada4...bc6e5d9. Read the comment docs.

@travisbrown travisbrown added this to the 2.1.0-RC3 milestone Dec 10, 2019
@LukaJCB LukaJCB merged commit f0b813d into typelevel:master Dec 10, 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.

4 participants