title: Function return tuple and the result is assigned to new variables
body: <p>I've just started learning F# very recently. I have a function which counts the coefficients of the linear equation: <code>y = ax + b</code>, based on coordinates of two points <code>P1(x1, y1)</code>, <code>P2(x1, y2)</code>. The function looks like this:</p>
  
  <pre><code>module LinearFit
  
  let generate(x1 : double, y1 : double, x2 : double, y2 : double) = 
      let w = x1 * 1.0 - x2 * 1.0
      let wa = y1 * 1.0 - y2 * 1.0
      let wb = x1 * y2 - x2 * y1     
  
  
      printfn "w: %g" w
      printfn "wa: %g" wa
      printfn "wb: %g" wb
  
      let a = wa/w
      let b = wb/w
  
      printfn "a: %g" a
      printfn "b: %g" b
  
  
      printfn "%g %g" a b
      (a, b)
  </code></pre>
  
  <p>I'm trying to somehow return founded coefficients as a tuple result and then assign the result to the new variables so later I can use the result to do some other operations. The trivial thing, for now, would be just displayed a result like:</p>
  
  <pre><code>The generated function is y = 2.5x - 6.5
  </code></pre>
  
  <p>So far I was trying to do sth like this</p>
  
  <pre><code>open System
  
  let main() =
      printf "Linear fit"
      (a: double, b: double) &lt;- LinearFit.generate(5.0, 6.0, 7.0, 11.0) 
      printfn "The generated functi..."
  
  main()
  
  Console.ReadKey()  |&gt; ignore
  </code></pre>
  
  <p>This is only a concept as I'm not even able to compile the project as im getting errors:</p>
  
  <pre><code>"Unexpected symbol ',' in expression"
  
  "Unexpected symbol ')' in binding."
  </code></pre>
  
  <p>I tried to find some similar approach to C#...
  For now what I want to achieve is just to assing the result of <code>generate</code> function to some variables. In C# it would look just like </p>
  
  <pre><code>public (double a, double b) Generate(some params here)
  {
      // some logic here
      return (a, b);
  }
  (var a, var b) = Generate(...);
  </code></pre>
  
  <p>Any ideas?</p>