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 EitherT.liftAttemptK #3374

Merged
merged 1 commit into from
Mar 31, 2020
Merged

Add EitherT.liftAttemptK #3374

merged 1 commit into from
Mar 31, 2020

Conversation

kubukoz
Copy link
Member

@kubukoz kubukoz commented Mar 29, 2020

No description provided.

@codecov-io
Copy link

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3374      +/-   ##
==========================================
+ Coverage   93.32%   93.32%   +<.01%     
==========================================
  Files         378      378              
  Lines        7728     7729       +1     
  Branches      207      209       +2     
==========================================
+ Hits         7212     7213       +1     
  Misses        516      516
Flag Coverage Δ
#scala_version_212 93.37% <100%> (ø) ⬆️
#scala_version_213 93.1% <100%> (ø) ⬆️
Impacted Files Coverage Δ
core/src/main/scala/cats/data/EitherT.scala 98.5% <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 97dbfeb...e75a32a. Read the comment docs.

* }}}
*/
final def liftAttemptK[F[_], E](implicit F: ApplicativeError[F, E]): F ~> EitherT[F, E, *] =
λ[F ~> EitherT[F, E, *]](fa => EitherT(F.attempt(fa)))
Copy link
Contributor

Choose a reason for hiding this comment

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

We've been removing the value-level kind-projector syntax for polymorphic functions, since there's no real possibility of it ever cross-building on Dotty, and since writing this out explicitly as:

new (F ~> EitherT[F, E, *]) { def apply[A](fa: F[A]): EitherT[F, E, A] = EitherT(F.attempt(fa)) }

…is only marginally less readable. I don't think that needs to be changed in this PR, though, since we're not actually cross-building on Dotty yet.

(Note that the type-level λ is fine on Dotty with -Ykind-projector.)

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, I was under the impression this was also part of the -Ykind-projector feature. But it makes sense, I'll keep it in mind.

Copy link
Contributor

Choose a reason for hiding this comment

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

@kubukoz No, I hate kind-projector's value-level lambda syntax and couldn't be bothered to implement it in -Ykind-projector. 😄 (Also it would have required much more disruptive changes than anything else that made it into -Ykind-projector.)

@travisbrown travisbrown merged commit f1817eb into typelevel:master Mar 31, 2020
@travisbrown travisbrown added this to the 2.2.0-M1 milestone Mar 31, 2020
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