title: Is there any difference between these two functions in F#?
body: <p>In F# is there any difference between writing a function like this...</p>
  
  <p><code>let add x y = x + y</code></p>
  
  <p>Or this...</p>
  
  <p><code>let add = fun x y -&gt; x + y</code></p>
  
  <p>When I look at the IL it seems they generate exactly the same type of IL. And they certainly "seem" to do the same thing but conceptually I feel they are different, the first being a function declaration and the second being a value declaration with the "value" being a function.</p>
  
  <p>Furthermore, if we would make a slightly more elaborate example..</p>
  
  <p>This...</p>
  
  <pre><code>let add x = 
      let rnd = System.Random()
      let rnd = rnd.Next(100)
      x + rnd
  </code></pre>
  
  <p>... Compared to this</p>
  
  <pre><code>let add = 
      let rnd = System.Random()
      let rnd = rnd.Next(100) 
      (fun x -&gt; x + rnd)
  </code></pre>
  
  <p>These examples follow the same principles as the previous two but these two will work wildly different from eachother..</p>