title: Scala syntax which I don't understand
body: <p>I started scala course on coursera, but I can't get one thing here:</p>
  
  <pre><code>trait Generator[+T] {
    self =&gt; // do this to be able to use self instead of this
  
    def generate: T
    def map[S](f: T =&gt; S): Generator[S] = new Generator[S] {
      def generate = f(self.generate)
    }
  }
  </code></pre>
  
  <p>Why we are using <code>map[S]</code> not just <code>map</code> in function definition?</p>