title: Case class and Linearization of traits
body: <p>Suppose that I want to write a case class <code>Stepper</code> as follows:</p>
  
  <pre><code>case class Stepper(step: Int) {def apply(x: Int) = x + step}
  </code></pre>
  
  <p>It comes with a nice <code>toString</code>implementation:</p>
  
  <pre><code>scala&gt; Stepper(42).toString
  res0: String = Stepper(42)
  </code></pre>
  
  <p>but it's not really a function:</p>
  
  <pre><code>scala&gt; Some(2) map Stepper(2)
  &lt;console&gt;:10: error: type mismatch;
   found   : Stepper
   required: Int =&gt; ?
                Some(2) map Stepper(2)
  </code></pre>
  
  <p>A workaround is to implement the <code>Function</code> trait...</p>
  
  <pre><code>case class Stepper(step: Int) extends (Int =&gt; Int) {def apply(x: Int) = x + step}
  </code></pre>
  
  <p>But then, I can't have for free a nice toString implementation anymore:</p>
  
  <pre><code>scala&gt; Stepper(42).toString
  res2: java.lang.String = &lt;function1&gt;
  </code></pre>
  
  <p>Then, the question is: can I have the best of these two worlds? Is there a solution where I have the nice <code>toString</code> implementation for free <em>AND</em> an implementation of trait <code>Function</code>. In other words, is there a way to apply the linearization in such a way that <code>case class</code> syntaxic sugar is applied at last?</p>