Skip to content

Instantly share code, notes, and snippets.

@joshcough
Last active December 16, 2015 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshcough/cd57998ef2bd51d5e202 to your computer and use it in GitHub Desktop.
Save joshcough/cd57998ef2bd51d5e202 to your computer and use it in GitHub Desktop.
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