added leftNel and rightNel syntax#2146
Merged
Merged
Conversation
LukaJCB
previously approved these changes
Jan 10, 2018
LukaJCB
reviewed
Jan 10, 2018
| * For example: | ||
| * {{{ | ||
| * scala> import cats.implicits._, cats.data.NonEmptyList | ||
| * scala> "Err".leftNel[Int] |
Member
There was a problem hiding this comment.
Whitespace error on the end of this line
LukaJCB
reviewed
Jan 10, 2018
| * For example: | ||
| * {{{ | ||
| * scala> import cats.implicits._, cats.data.NonEmptyList | ||
| * scala> 1.rightNel[String] |
Member
There was a problem hiding this comment.
This line also has an extra space
LukaJCB
previously approved these changes
Jan 10, 2018
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.
|
peterneyens
previously approved these changes
Jan 12, 2018
| * res0: Either[NonEmptyList[String], Int] = Left(NonEmptyList(Err)) | ||
| * }}} | ||
| */ | ||
| def leftNel[B]: Either[NonEmptyList[A], B] = Left(NonEmptyList.of(obj)) |
Contributor
There was a problem hiding this comment.
You could use NonEmptyList.one here.
LukaJCB
approved these changes
Jan 12, 2018
peterneyens
approved these changes
Jan 12, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
since
EitherNelis a lot more useful with theParallelTC