-
-
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
added leftNel
and rightNel
syntax
#2146
Conversation
* For example: | ||
* {{{ | ||
* scala> import cats.implicits._, cats.data.NonEmptyList | ||
* scala> "Err".leftNel[Int] |
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.
Whitespace error on the end of this line
* For example: | ||
* {{{ | ||
* scala> import cats.implicits._, cats.data.NonEmptyList | ||
* scala> 1.rightNel[String] |
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 line also has an extra space
Codecov Report
@@ Coverage Diff @@
## master #2146 +/- ##
==========================================
+ Coverage 94.66% 94.67% +<.01%
==========================================
Files 328 328
Lines 5533 5538 +5
Branches 199 199
==========================================
+ Hits 5238 5243 +5
Misses 295 295
Continue to review full report at Codecov.
|
* res0: Either[NonEmptyList[String], Int] = Left(NonEmptyList(Err)) | ||
* }}} | ||
*/ | ||
def leftNel[B]: Either[NonEmptyList[A], B] = Left(NonEmptyList.of(obj)) |
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.
You could use NonEmptyList.one
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.
👍
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! @peterneyens addressed.
since
EitherNel
is a lot more useful with theParallel
TC