title: Scala method = trait { ... } meaning
body: <p>I'm trying to learn Scala and the Play Framework at the same time.  Scala looks to me like it has a lot of really cool ideas, but one of my frustrations is trying to understand all of the different syntaxes for methods/functions/lambdas/anonymous functions/etc.</p>
  
  <p>So I have my main application controller like so:</p>
  
  <pre><code>object Application extends Controller {
    def index = Action {
      Ok(views.html.index("Your new application is ready."))
    }
  }
  </code></pre>
  
  <p>This tells me I have a singleton <code>Application</code> that has one method, <code>index</code>, that returns what type??  I was expecting <code>index</code> to have a definition more like:</p>
  
  <pre><code>def index(req: Request) : Result = { ... }
  </code></pre>
  
  <p>Looking at Play Framework's documentation, it looks as though <code>Action</code> is a trait, that transforms a request to a result, by I'm having a hard time understanding what this line is saying:</p>
  
  <pre><code>def index = Action { ... }
  </code></pre>
  
  <p>I come from a Java background, so I don't know what this is saying?  (this statement <em>feels</em> like it's saying "method index = [some interface Action]", which doesn't make sense to me; it seems something beautiful is happening, but it is magic to me, and I feel uneasy with magic in my code ;))</p>