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

Override fromTry and fromEither for Try and Either #1660

Merged
merged 1 commit into from
May 11, 2017

Conversation

peterneyens
Copy link
Collaborator

  • Overrides ApplicativeError#fromTry for Try
  • Overrides ApplicativeError#fromEither for Either
  • Add an additional law for ApplicativeError ensuring consistency between attempt + fromEither and pure.

The last two are sort of a follow up after #1651.

Add an ApplicativeError law ensuring consistency between
attempt/fromEither and pure.
@codecov-io
Copy link

codecov-io commented May 11, 2017

Codecov Report

Merging #1660 into master will decrease coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1660      +/-   ##
==========================================
- Coverage   93.38%   93.33%   -0.05%     
==========================================
  Files         240      240              
  Lines        3943     3945       +2     
  Branches      137      134       -3     
==========================================
  Hits         3682     3682              
- Misses        261      263       +2
Impacted Files Coverage Δ
core/src/main/scala/cats/instances/either.scala 97.61% <ø> (ø) ⬆️
core/src/main/scala/cats/instances/try.scala 96.29% <ø> (ø) ⬆️
...rc/main/scala/cats/laws/ApplicativeErrorLaws.scala 100% <100%> (ø) ⬆️
...a/cats/laws/discipline/ApplicativeErrorTests.scala 100% <100%> (ø) ⬆️
core/src/main/scala/cats/ApplicativeError.scala 86.66% <0%> (-13.34%) ⬇️

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 8c38980...51e4e61. Read the comment docs.

@@ -46,7 +46,8 @@ trait ApplicativeErrorTests[F[_], E] extends ApplicativeTests[F] {
"applicativeError handleErrorWith consistent with recoverWith" -> forAll(laws.handleErrorWithConsistentWithRecoverWith[A] _),
"applicativeError handleError consistent with recover" -> forAll(laws.handleErrorConsistentWithRecover[A] _),
"applicativeError recover consistent with recoverWith" -> forAll(laws.recoverConsistentWithRecoverWith[A] _),
"applicativeError attempt consistent with attemptT" -> forAll(laws.attemptConsistentWithAttemptT[A] _)
"applicativeError attempt consistent with attemptT" -> forAll(laws.attemptConsistentWithAttemptT[A] _),
Copy link
Contributor

Choose a reason for hiding this comment

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

good catch.

@kailuowang
Copy link
Contributor

👍 thanks, I thought about raising those up in that PR, but somehow it slipped my mind.

@ceedubs
Copy link
Contributor

ceedubs commented May 11, 2017

👍 thanks!

@ceedubs ceedubs merged commit 2580d74 into typelevel:master May 11, 2017
@peterneyens peterneyens deleted the from-either-from-try branch May 11, 2017 20:43
@kailuowang kailuowang modified the milestone: 1.0.0-MF May 18, 2017
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 this pull request may close these issues.

5 participants