title: Functional Programming in Scala
body: <p>My question is about Lambda in Unit6.4</p>
  
  <pre><code>trait RNG {
    def nextInt: (Int, RNG)
  }
  
  type Rand[+A] = RNG =&gt; (A, RNG)
  
  val int: Rand[Int] = _.nextInt
  </code></pre>
  
  <p>Why <code>"_.nextInt"</code> can equal <code>"x =&gt; x.nextInt"</code>.</p>
  
  <p>In Java8, <code>(RNGｒ) -&gt; r.nextInt()</code> can be replaced like <code>RNG::nextInt</code>(a function reference).</p>
  
  <p>So I want to understand what's the difference between <code>"_.nextInt"</code> and <code>"RNG::nextInt"</code>,and why <code>"val int: Rand[Int] = x.nextInt"</code>, "x" can not match RNG but <code>"_"</code> can.</p>
  
  <p><img src="https://i.stack.imgur.com/oiMyA.png" alt="enter image description here"></p>