Created
February 6, 2011 09:01
-
-
Save debasishg/813243 to your computer and use it in GitHub Desktop.
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
scala> val d: Validation[String, Int] = 12.success | |
d: scalaz.Validation[String,Int] = Success(12) | |
scala> val e: Validation[String, String] = "ghosh".success | |
e: scalaz.Validation[String,String] = Success(ghosh) | |
scala> (d, e) | |
res18: (scalaz.Validation[String,Int], scalaz.Validation[String,String]) = (Success(12),Success(ghosh)) | |
// I want to get Validation[String, (Int, Int)] out of this. The closest I could get is .. | |
scala> (d, e).sequence[({type λ[α]=Validation[java.lang.String, α]})#λ, String] | |
res38: scalaz.Validation[java.lang.String,(scalaz.Validation[String,Int], String)] = Success((Success(12),ghosh)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks .. I was tricked into thinking in terms of sequence .. Alexey also suggested the same on the ML ..