import scalaz.syntax.std.string._

...

val l: String = ...
val v = l.parseLong // Validation[scala.NumberFormatException, Long]
  1. fold
v.fold(f, s)

...

  /** Catamorphism. Run the first given function if failure, otherwise, the second given function. */
  def fold[X](fail: E => X, succ: A => X): X = this match {
    case Success(x) => succ(x)
    case Failure(x) => fail(x)
  }
  1. toOption