Skip to content

Add leftFlatMap to Either#2149

Merged
johnynek merged 2 commits into
typelevel:masterfrom
rohanshah:either-leftFlatMap
Jan 12, 2018
Merged

Add leftFlatMap to Either#2149
johnynek merged 2 commits into
typelevel:masterfrom
rohanshah:either-leftFlatMap

Conversation

@rohanshah
Copy link
Copy Markdown
Contributor

Motivation

Either should have leftFlatMap for cases when you want to leftMap a function that returns an Either and flatten the total result.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jan 11, 2018

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2149      +/-   ##
==========================================
+ Coverage   94.66%   94.67%   +<.01%     
==========================================
  Files         328      328              
  Lines        5533     5536       +3     
  Branches      199      199              
==========================================
+ Hits         5238     5241       +3     
  Misses        295      295
Impacted Files Coverage Δ
core/src/main/scala/cats/syntax/either.scala 99.14% <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 65d5933...6c9e95c. Read the comment docs.

@kailuowang
Copy link
Copy Markdown
Contributor

would love to see some tests

@rohanshah
Copy link
Copy Markdown
Contributor Author

@kailuowang yeah, I was wondering where to put them. The only test file I found for Either was EitherSuite.scala but that didn't even have a test for flatMap in it.

@kailuowang
Copy link
Copy Markdown
Contributor

EitherSuite should be the right place. My guess is that flatMap isn't explicitly tested there because it's covered by the law tests

@rohanshah
Copy link
Copy Markdown
Contributor Author

@kailuowang added tests!

@kailuowang kailuowang added this to the 1.1 milestone Jan 12, 2018
@johnynek johnynek merged commit 5f30a73 into typelevel:master Jan 12, 2018
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