title: Cannot get the name of a function passed as a parameter with code quotations, in F#
body: <p>I have a function that looks like that:</p>
  <pre><code>let rec retryAsync (retryAttempts: TimeSpan list) (request: unit -&gt; Async&lt;Result&lt;'a, ExchangeError&gt;&gt;) : Async&lt;Result&lt;'a, ExchangeError&gt;&gt; = ....
  </code></pre>
  <p>and, upon an error I would like to print the name of the function passed as '<em>request</em>'. It has this signature:</p>
  <pre><code>unit -&gt; Async&lt;Result&lt;'a, ExchangeError&gt;&gt;
  </code></pre>
  <p>I thought about using something like this (slightly modified version of code I found online):</p>
  <pre><code>module DocumentGetter =
      let GetName ([&lt;ReflectedDefinition&gt;]x:Expr&lt;_-&gt;_&gt;) =
          match x with
          | DerivedPatterns.Lambdas(_, Patterns.Call(_,methodInfo,_)) -&gt;
              methodInfo.Name
          | _ -&gt; &quot;unknown&quot;
  </code></pre>
  <p>but then I get this compile error:</p>
  <blockquote>
  <p>[FS0001] The type 'unit -&gt; Async&lt;Result&lt;'a,ExchangeError&gt;&gt;' is not compatible with the type 'Quotations.Expr&lt;('b -&gt; 'c)&gt;'</p>
  </blockquote>
  <p>If I pass the main function (retryAsync), I can get the name out, but I can't get the name of the function passed to it. Why is that?</p>