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

MonadErrorOps#reject runs non-rejected effects twice #2809

Closed
bplommer opened this issue Apr 25, 2019 · 0 comments · Fixed by #2810
Closed

MonadErrorOps#reject runs non-rejected effects twice #2809

bplommer opened this issue Apr 25, 2019 · 0 comments · Fixed by #2810

Comments

@bplommer
Copy link
Contributor

bplommer commented Apr 25, 2019

Example ammonite script:

import $ivy.`org.typelevel::cats-effect:1.2.0`
import cats.syntax.monadError._
import cats.effect.IO

IO(println("this should only be printed once")) // printed twice
  .reject { case _ if false => new Throwable}
  .unsafeRunSync()

Fixed in #2810

bplommer pushed a commit to bplommer/cats that referenced this issue Apr 25, 2019
kailuowang pushed a commit that referenced this issue Apr 25, 2019
* Add regression test for MonadErrorOps bug

* Change MonadErrorOps#reject so it no longer re-runs the effect it is called on. Fixes #2809
rossabaker pushed a commit to rossabaker/cats that referenced this issue May 26, 2019
…evel#2810)

* Add regression test for MonadErrorOps bug

* Change MonadErrorOps#reject so it no longer re-runs the effect it is called on. Fixes typelevel#2809
rossabaker added a commit that referenced this issue Jun 3, 2019
* Change MonadErrorOps#reject so it no longer runs effects twice (#2810)

* Add regression test for MonadErrorOps bug

* Change MonadErrorOps#reject so it no longer re-runs the effect it is called on. Fixes #2809

* Fix Order.max and Oder.min description comments (#2842)

Changed description to better fit their implentation

* Make WrappedMutableMapBase extend Serializable (#2784)

We are running into Spark `Task not serializable` issues when a closure
that executes on a Spark executor node involves a `Map` that is created
via running `foldMap` on a `List`. This commit makes the
`WrappedMutableMap` hierarchy extend `Serializable` and chex that the
cerealization works (this test failed before extending `Serializable`).

* Optimize productR in Apply (#2728)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant