title: Scala Function.tupled vs f.tupled
body: <p>I have the following Scala code:</p>
  
  <pre><code>def f(x: Int, y: Int): Option[String] = x*y match {
      case 0 =&gt; None
      case n =&gt; Some(n.toString)
  }
  
  val data = List((0, 1), (1, 0), (2, 3), (4, -1))
  
  data flatMap {case (x, y) =&gt; f(x, y)}
  </code></pre>
  
  <p>But, the last line is too verbose so I tried all of these and none of them compiles. </p>
  
  <p><code>data flatMap f</code></p>
  
  <p><code>data flatMap f.tupled</code></p>
  
  <p><code>data flatMap Function.tupled(f)</code></p>
  
  <p><code>data flatMap {f _}</code></p>
  
  <p><code>data flatMap (f _).tupled</code></p>
  
  <p><code>data flatMap f(_)</code></p>
  
  <p>What am I doing wrong? The only thing that works is this:</p>
  
  <p><code>(data map Function.tupled(f)).flatten</code></p>
  
  <p>I thought a <code>map</code> followed by <code>flatten</code> can always be replaced by <code>flatMap</code>, but although the above line compiles, this does not:</p>
  
  <p><code>data flatMap Function.tupled(f)</code></p>