<p>Is it possible to pass a reference to a function to another function in F#?  Specifically, I'd like to pass lambda functions like</p>

<p>foo(fun x -> x ** 3)</p>

<p>More specifically, I need to know how I would refer to the passed function in a function that I wrote myself.</p>

[{'answer_id': 44079, 'author': 'Mark Cidade', 'author_id': 1659, 'author_profile': 'https://Stackoverflow.com/users/1659', 'pm_score': 4, 'selected': True, 'text': '<p>Yes, it is possible. The <a href="http://research.microsoft.com/fsharp/manual/spec2.aspx#_Toc207785549" rel="noreferrer">manual</a> has this example:</p>\n\n<pre><code>&gt; List.map (fun x -&gt; x % 2 = 0) [1 .. 5];;\n\nval it : bool list\n= [false; true; false; true; false]\n</code></pre>\n'}, {'answer_id': 44082, 'author': 'nickd', 'author_id': 2373, 'author_profile': 'https://Stackoverflow.com/users/2373', 'pm_score': 2, 'selected': False, 'text': '<p>Functions are first class citizens in F#. You can therefore pass them around just like you want to.</p>\n\n<p>If you have a function like this:</p>\n\n<pre><code>let myFunction f =\n    f 1 2 3\n</code></pre>\n\n<p>and <strong>f</strong> is function then the return value of <strong>myFunction</strong> is <strong>f</strong> applied to 1,2 and 3.</p>\n'}, {'answer_id': 60508, 'author': 'Michiel Borkent', 'author_id': 6264, 'author_profile': 'https://Stackoverflow.com/users/6264', 'pm_score': 2, 'selected': False, 'text': '<p>Passing a lambda function to another function works like this:</p>\n\n<p>Suppose we have a trivial function of our own as follows:</p>\n\n<pre><code>let functionThatTakesaFunctionAndAList f l = List.map f l\n</code></pre>\n\n<p>Now you can pass a lambda function and a list to it:</p>\n\n<pre><code>functionThatTakesaFunctionAndAList (fun x -&gt; x ** 3.0) [1.0;2.0;3.0]\n</code></pre>\n\n<p>Inside our own function <code>functionThatTakesaFunctionAndAList</code> you can just refer to the lambda function as <code>f</code> because you called your first parameter <code>f</code>.</p>\n\n<p>The result of the function call is of course:</p>\n\n<pre><code>float list = [1.0; 8.0; 27.0]\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/44066', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2270/']