Last active
December 16, 2015 20:33
-
-
Save joshcough/cd57998ef2bd51d5e202 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> import scalaz.syntax._, validation._, either._, monadPlus._ | |
import scalaz.syntax._ | |
import validation._ | |
import either._ | |
import monadPlus._ | |
scala> import scalaz.std.list._ | |
import scalaz.std.list._ | |
scala> List(1.left, 2.left, "bad".right, "really bad".right).separate | |
res0: (List[Int], List[String]) = (List(1, 2),List(bad, really bad)) | |
scala> List(1.success[List[String]], "bad".failure[List[Int]], "really bad".failure[List[Int]], 2.success[List[String]]) | |
res1: List[scalaz.Validation[Object,Any]] = List(Success(1), Failure(bad), Failure(really bad), Success(2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment