-
-
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 and IorT constructors from Option with monad left value #3457
Add EitherT and IorT constructors from Option with monad left value #3457
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3457 +/- ##
==========================================
+ Coverage 91.60% 91.61% +0.01%
==========================================
Files 382 382
Lines 8311 8321 +10
Branches 226 223 -3
==========================================
+ Hits 7613 7623 +10
Misses 698 698 |
Sorry, now I read it again, my last comment was not really clear. Let me try again. val foa: F[Option[A]] = ???
foa.map(_.liftTo[M](e)) This gives you a If we find Then with these two helper syntax methods combined, you can write foa.lfitTo[EitherT[F, E, *][(e).flattenEitherT which turns On other side, we can add a foa.map(_.raiseTo[M][(defaultValue)) which turns a Note that we are using Please take this as a starting point of a discussion, let me know what you think. |
That's the point, right. There are simple ways to provide a plain error but my case is not quite
but (F[Opiton[A]], F[E]) => EitherT[F, E, A] or better with call-by-name (foa: F[Opiton[A]], fe: => F[E]) => EitherT[F, E, A] |
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.
@ivan-klass ah I apologize, I missed "may also require the left to be calculated as F[E]. " from your original PR.
This PR looks good to me as is now.
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.
Thanks for bearing with us! :)
This is to follow-up on feedback for #3426
@kailuowang I'm trying to understand the idea in your feedback comment
Do you mean that we can add something like
?
There could be partially applied helper objects to simplify type-hints - so we only have to provide
G[_]
manually and E could be inferred from argumentDid I get the idea right? Thanks