Skip to content

Add toValidatedNel to Xor#971

Merged
adelbertc merged 1 commit into
typelevel:masterfrom
liff:topic/xor-toValidatedNel
Apr 6, 2016
Merged

Add toValidatedNel to Xor#971
adelbertc merged 1 commit into
typelevel:masterfrom
liff:topic/xor-toValidatedNel

Conversation

@liff
Copy link
Copy Markdown
Contributor

@liff liff commented Apr 5, 2016

As a convenient shorthand for xor.toValidated.toValidatedNel.

I suppose .toValidatedNel should be the version more often used since the point of Validated is to accumulate errors?

As a convenient shorthand for xor.toValidated.toValidatedNel.
@codecov-io
Copy link
Copy Markdown

Current coverage is 90.87%

Merging #971 into master will not affect coverage as of 95f759a

@@            master    #971   diff @@
======================================
  Files          181     181       
  Stmts         2158    2159     +1
  Branches        42      42       
  Methods          0       0       
======================================
+ Hit           1961    1962     +1
  Partial          0       0       
  Missed         197     197       

Review entire Coverage Diff as of 95f759a

Powered by Codecov. Updated on successful CI builds.

@stew
Copy link
Copy Markdown
Contributor

stew commented Apr 6, 2016

👍

@adelbertc
Copy link
Copy Markdown
Contributor

Is the [AA >: A] needed here?

@liff
Copy link
Copy Markdown
Contributor Author

liff commented Apr 6, 2016

It doesn't compile without:

cats/core/src/main/scala/cats/data/Xor.scala:75: covariant type A occurs in invariant position in type => cats.data.ValidatedNel[A,B] of method toValidatedNel
  def toValidatedNel: ValidatedNel[A,B] = fold(Validated.invalidNel, Validated.valid)
      ^

Is it due to OneAnd's invariance?

@adelbertc
Copy link
Copy Markdown
Contributor

Ah yes 👍

@adelbertc adelbertc merged commit b3033e2 into typelevel:master Apr 6, 2016
@liff liff deleted the topic/xor-toValidatedNel branch April 25, 2016 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants