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 Ior.fromEither #2057

Merged
merged 2 commits into from
Dec 1, 2017
Merged

Add Ior.fromEither #2057

merged 2 commits into from
Dec 1, 2017

Conversation

markus1189
Copy link
Contributor

@markus1189 markus1189 commented Dec 1, 2017

Adds the Ior.fromEither method. I am aware that there is a toIor provided via EitherOps, but this one is harder to find for newcomers (IMHO :D) and needs the import of the EitherSyntax.

So I added the Ior.fromEither which does not require any import and is easily discoverable on the Ior companion.

24 Pull Requests (https://24pullrequests.com)

https://24pullrequests.com

LukaJCB
LukaJCB previously approved these changes Dec 1, 2017
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.

This is great, thanks!

* Create an `Ior` from an `Either`.
* @param eab an `Either` from which the `Ior` should be created
*
* @return [[Ior.Left]] if the `Either` was a `Left`,
Copy link
Member

Choose a reason for hiding this comment

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

You have a whitespace error here :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice that cats checks for them!

@codecov-io
Copy link

codecov-io commented Dec 1, 2017

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2057   +/-   ##
=======================================
  Coverage   94.95%   94.95%           
=======================================
  Files         311      311           
  Lines        5270     5270           
  Branches      133      132    -1     
=======================================
  Hits         5004     5004           
  Misses        266      266
Impacted Files Coverage Δ
core/src/main/scala/cats/syntax/either.scala 99.12% <100%> (-0.02%) ⬇️
core/src/main/scala/cats/data/Ior.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 40465ac...42fc926. Read the comment docs.

@kailuowang kailuowang added this to the 1.0.0 milestone Dec 1, 2017
@kailuowang kailuowang mentioned this pull request Dec 1, 2017
3 tasks
@kailuowang kailuowang merged commit f29dc72 into typelevel:master Dec 1, 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