-
Notifications
You must be signed in to change notification settings - Fork 95
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 convenient syntax for working with F[Either[E, A]] #169
Conversation
F.lift(e) | ||
} | ||
|
||
def mergeF(implicit ev: L =:= R, F: Functor[F]): F[R] = { |
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.
def mergeF[A >: R](implicit ev: L <:< A, F: Functor[F]): F[A]
?
F.flatMap(productF(eb))(_.traverse { case (r, r1) => f(r, r1) }) | ||
} | ||
|
||
def mapK[G[_]](implicit F: ~>[F, G]): G[Either[L, R]] = { |
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.
I don't think that's a good idea to make natural transformation implicit.
Do we really need mapK and liftTo methods here?
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.
At the last minute i became doubted about it but decided to left it. So, if it doesn't looks good enough i can cut it.
F.flatMap(e) { | ||
case Right(right) => f(right) | ||
case left @ Left(_) => F.pure(left.rightCast) | ||
} |
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.
I think we can keep just one method from doubleFlatMap, flatMapF
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.
Ok, seems good
This PR resolve #149
I had some questions about documentation in source file and do i need to use helpers in tests or not?