title: How to accumulate errors in Either?
body: <p>Suppose I have few case classes and functions to test them:</p>
  
  <pre><code>case class PersonName(...)
  case class Address(...)
  case class Phone(...)
  
  def testPersonName(pn: PersonName): Either[String, PersonName] = ...
  def testAddress(a: Address): Either[String, Address] = ...
  def testPhone(p: Phone): Either[String, Phone] = ...
  </code></pre>
  
  <p>Now I define a new case class <code>Person</code> and a test function, which <em>fails fast</em>.</p>
  
  <pre><code>case class Person(name: PersonName, address: Address, phone: Phone)
  
  def testPerson(person: Person): Either[String, Person] = for {
    pn &lt;- testPersonName(person.name).right
    a &lt;- testAddress(person.address).right
    p &lt;- testPhone(person.phone).right
  } yield person;
  </code></pre>
  
  <p>Now I would like function <code>testPerson</code> to <em>accumulate</em> the errors rather than just fail fast. </p>
  
  <p>I would like <code>testPerson</code> to always execute all those <code>test*</code> functions and return <code>Either[List[String], Person]</code>. How  can I do that ?</p>