-
-
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
Give NonEmptyChain more presence #2431
Conversation
eaaca6c
to
1f16bb8
Compare
@@ -205,6 +205,8 @@ final case class EitherT[F[_], A, B](value: F[Either[A, B]]) { | |||
def toValidatedNel(implicit F: Functor[F]): F[ValidatedNel[A, B]] = | |||
F.map(value)(_.toValidatedNel) | |||
|
|||
def toValidatedNec(implicit F: Functor[F]): F[ValidatedNec[A, B]] = ??? |
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.
implementation coming, I assume....
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.
this is still a ???
We should consider a CI check that we can't merge with that present.
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.
Also, can we add a test to exercise this, since we must not have it 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.
@johnynek I think that you are looking at outdated code. For me there's no longer ???
in the PR.
final class EitherOpsBinCompat0[A, B](val value: Either[A, B]) extends AnyVal { | ||
/** Returns a [[cats.data.ValidatedNec]] representation of this disjunction with the `Left` value | ||
* as a single element on the `Invalid` side of the [[cats.data.NonEmptyList]]. */ | ||
def toValidatedNec[AA >: A]: ValidatedNec[AA, B] = value match { |
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.
since Validated is covariant, do we need this type parameted?
Codecov Report
@@ Coverage Diff @@
## master #2431 +/- ##
==========================================
+ Coverage 95.21% 95.22% +0.01%
==========================================
Files 351 351
Lines 6369 6387 +18
Branches 286 287 +1
==========================================
+ Hits 6064 6082 +18
Misses 305 305
Continue to review full report at Codecov.
|
These are good questions, I just adopted the type signatures from the |
8d31a63
to
46c513d
Compare
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.
Absent a reason how this is different from NonEmptyList
, or how NEL
's choices cause serious remorse in 1.0, being consistent with NonEmptyList
is compelling to me.
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.
This adds the
ValidatedNec
type alias as well as several api enhancements that were previously only available toNonEmptyList