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 FlatMap.forEffect #1537

Merged
merged 3 commits into from
Apr 12, 2017
Merged

Add FlatMap.forEffect #1537

merged 3 commits into from
Apr 12, 2017

Conversation

cranst0n
Copy link
Contributor

See #1535.

@codecov-io
Copy link

codecov-io commented Apr 5, 2017

Codecov Report

Merging #1537 into master will increase coverage by 0.61%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1537      +/-   ##
==========================================
+ Coverage   92.42%   93.04%   +0.61%     
==========================================
  Files         249      249              
  Lines        3974     3980       +6     
  Branches      131      139       +8     
==========================================
+ Hits         3673     3703      +30     
+ Misses        301      277      -24
Impacted Files Coverage Δ
...main/scala/cats/laws/discipline/FlatMapTests.scala 100% <100%> (ø) ⬆️
core/src/main/scala/cats/instances/tuple.scala 100% <100%> (ø) ⬆️
laws/src/main/scala/cats/laws/FlatMapLaws.scala 100% <100%> (ø) ⬆️
core/src/main/scala/cats/FlatMap.scala 92.3% <66.66%> (-7.7%) ⬇️
core/src/main/scala/cats/data/Coproduct.scala
core/src/main/scala/cats/data/Prod.scala
core/src/main/scala/cats/syntax/coproduct.scala
core/src/main/scala/cats/syntax/eitherK.scala 100% <0%> (ø)
core/src/main/scala/cats/data/Tuple2K.scala 100% <0%> (ø)
core/src/main/scala/cats/data/EitherK.scala 100% <0%> (ø)
... and 9 more

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 dbe4407...2da3ac3. Read the comment docs.

def forEffect[A, B](fa: F[A])(fb: F[B]): F[A] = flatMap(fa)(a => map(fb)(_ => a))

/** Alias for [[forEffect]]. */
@inline final def <<[A, B](fa: F[A])(fb: F[B]): F[A] = forEffect(fa)(fb)
Copy link
Contributor

Choose a reason for hiding this comment

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

This line is the only missed test coverage, I think it's fine.

@kailuowang kailuowang added this to the 1.0.0-MF milestone Apr 11, 2017
@johnynek
Copy link
Contributor

👍

@kailuowang kailuowang merged commit 9c3130e into typelevel:master Apr 12, 2017
@kailuowang kailuowang modified the milestone: 1.0.0-MF Apr 26, 2017
@peterneyens peterneyens mentioned this pull request May 5, 2017
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