Skip to content

Add Ior.fromEither - #2057

Merged
kailuowang merged 2 commits into
typelevel:masterfrom
markus1189:ior-fromeither
Dec 1, 2017
Merged

Add Ior.fromEither#2057
kailuowang merged 2 commits into
typelevel:masterfrom
markus1189:ior-fromeither

Conversation

@markus1189

@markus1189 markus1189 commented Dec 1, 2017

Copy link
Copy Markdown
Contributor

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

@LukaJCB LukaJCB left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is great, thanks!

Comment thread core/src/main/scala/cats/data/Ior.scala Outdated
* 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
Copy Markdown
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
Copy Markdown
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

codecov-io commented Dec 1, 2017

Copy link
Copy Markdown

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