Validation versus disjunction
问题 Suppose I want to write a method with the following signature: def parse(input: List[(String, String)]): ValidationNel[Throwable, List[(Int, Int)]] For each pair of strings in the input, it needs to verify that both members can be parsed as integers and that the first is smaller than the second. It then needs to return the integers, accumulating any errors that turn up. First I'll define an error type: import scalaz._, Scalaz._ case class InvalidSizes(x: Int, y: Int) extends Exception( s