title: How to refactor the method of `IsAuthenticated` to provide a better api
body: <p>I have a <code>IsAuthenticated</code> method which has a complex argument type (I copied it from play2's zentasks example):</p>
  
  <pre><code>def IsAuthenticated(f: =&gt; String =&gt; Request[AnyContent] =&gt; Result): Action[(Action[AnyContent], AnyContent)] =
    Security.Authenticated(username, onUnauthorized) { userId =&gt;
      Action { implicit request =&gt;
        val email = request.session("user.email")
        f(email)(request)
      }
    }
  </code></pre>
  
  <p>In order to use it, my action is:</p>
  
  <pre><code>def delete(id:String) = IsAuthenticated { email =&gt; request =&gt;
     ...
  }
  </code></pre>
  
  <p>You can see I have to declare <code>email</code> event if I don't need to use it. I can use <code>_</code> instead:</p>
  
  <pre><code>def delete(id:String) = IsAuthenticated { _ =&gt; _ =&gt;
     ...
  }
  </code></pre>
  
  <p>But <code>_ =&gt; _ =&gt;</code> is still boring.</p>
  
  <p>How to refactor the method to let it's usage simpler? e.g. If I don't need <code>email</code> and <code>request</code>, I can:</p>
  
  <pre><code>def delete(id:String) = IsAuthenticated {
     ...
  }
  </code></pre>
  
  <p>If I just need <code>request</code>, I can:</p>
  
  <pre><code>def delete(id:String) = IsAuthenticated { request =&gt;
     ...
  }
  </code></pre>
  
  <p>If I need <code>email</code>, then I declare them all:</p>
  
  <pre><code>def delete(id:String) = IsAuthenticated { email =&gt; request =&gt;
     ...
  }
  </code></pre>