-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add EitherT.liftAttemptK #3374
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
* }}} | ||
*/ | ||
final def liftAttemptK[F[_], E](implicit F: ApplicativeError[F, E]): F ~> EitherT[F, E, *] = | ||
λ[F ~> EitherT[F, E, *]](fa => EitherT(F.attempt(fa))) |
There was a problem hiding this comment.
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
.)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.)
No description provided.