title: Compose and andThen methods
body: <p>I'm following the tutorial <em><a href="http://twitter.github.com/scala_school/pattern-matching-and-functional-composition.html">Pattern matching &amp; functional composition</a></em> on Scala <code>compose</code> and <code>andThen</code> methods. There's such an example:</p>
  
  <pre><code>scala&gt; def addUmm(x: String) = x + " umm"
  scala&gt; def addAhem(x: String) = x + " ahem"
  
  val ummThenAhem = addAhem(_).compose(addUmm(_))
  </code></pre>
  
  <p>When I try to use it I get an error:</p>
  
  <pre><code>&lt;console&gt;:7: error: missing parameter type for expanded function ((x$1) =&gt; addAhem(x$1).compose(((x$2) =&gt; addUmm(x$2))))
     val ummThenAhem = addAhem(_).compose(addUmm(_))
                               ^
  &lt;console&gt;:7: error: missing parameter type for expanded function ((x$2) =&gt; addUmm(x$2))
     val ummThenAhem = addAhem(_).compose(addUmm(_))
                                                 ^
  &lt;console&gt;:7: error: type mismatch;
   found   : java.lang.String
   required: Int
       val ummThenAhem = addAhem(_).compose(addUmm(_))
  </code></pre>
  
  <p>However, this works:</p>
  
  <pre><code>val ummThenAhem = addAhem _ compose addUmm _
  </code></pre>
  
  <p>or even </p>
  
  <pre><code>val ummThenAhem = addAhem _ compose addUmm
  </code></pre>
  
  <p>What's wrong with the code in the tutorial? Isn't the latter expression the same as the first one without parenthesis?</p>