title: What's the relation of fold on Option, Either etc and fold on Traversable?
body: <p>Scalaz provides a method named <code>fold</code> for various ADTs such as <code>Boolean</code>, <code>Option[_]</code>, <code>Validation[_, _]</code>, <code>Either[_, _]</code> etc. This method basically takes functions corresponding to all possible cases for that given ADT. In other words, a pattern match shown below:</p>
  
  <pre><code>x match {
    case Case1(a, b, c) =&gt; f(a, b, c)
    case Case2(a, b) =&gt; g(a, b)
    .
    .
    case CaseN =&gt; z
  }
  </code></pre>
  
  <p>is equivalent to:</p>
  
  <pre><code>x.fold(f, g, ..., z)
  </code></pre>
  
  <p>Some examples:</p>
  
  <pre><code>scala&gt; (9 == 8).fold("foo", "bar")
  res0: java.lang.String = bar
  
  scala&gt; 5.some.fold(2 *, 2)
  res1: Int = 10
  
  scala&gt; 5.left[String].fold(2 +, "[" +)
  res2: Any = 7
  
  scala&gt; 5.fail[String].fold(2 +, "[" +)
  res6: Any = 7
  </code></pre>
  
  <p>At the same time, there is an operation with the same name for the <code>Traversable[_]</code> types, which traverses over the collection performing certain operation on its elements, and accumulating the result value. For example, </p>
  
  <pre><code>scala&gt; List(2, 90, 11).foldLeft("Contents: ")(_ + _.toString + " ")
  res9: java.lang.String = "Contents: 2 90 11 "
  
  scala&gt; List(2, 90, 11).fold(0)(_ + _)
  res10: Int = 103
  
  scala&gt; List(2, 90, 11).fold(1)(_ * _)
  res11: Int = 1980
  </code></pre>
  
  <p>Why are these two operations identified with the same name - <code>fold</code>/catamorphism? I fail to see any similarities/relation between the two. What am I missing?</p>