How come I can pass functions to a lifted R.divide?
<p>Given the following: </p>

<pre><code>var average = R.lift(R.divide)(R.sum, R.length)
</code></pre>

<p>How come this works as a pointfree implementation of <code>average</code>? I don't understand why I can pass <code>R.sum</code> and <code>R.length</code> when they are functions and therefore, I cannot map the lifted <code>R.divide</code> over the functions <code>R.sum</code> and <code>R.length</code> unlike in the following example:</p>

<pre><code>var sum3 = R.curry(function(a, b, c) {return a + b + c;});
R.lift(sum3)(xs)(ys)(zs)
</code></pre>

<p>In the above case the values in <code>xs</code>, <code>ys</code> and <code>zs</code> are summed in a non deterministic context, in which case the lifted function is applied to the values in the given computational context.</p>

<p>Expounding further, I understand that applying a lifted function is like using <code>R.ap</code> consecutively to each argument. Both lines evaluate to the same output:</p>

<pre><code>R.ap(R.ap(R.ap([tern], [1, 2, 3]), [2, 4, 6]), [3, 6, 8])
R.lift(tern)([1, 2, 3], [2, 4, 6], [3, 6, 8])
</code></pre>

<p>Checking the documentation it says:</p>

<blockquote>
  <p>"lifts" a function of arity > 1 so that it may "map over" a list, Function or other object that satisfies the FantasyLand Apply spec.</p>
</blockquote>

<p>And that doesn't seem like a very useful description at least for me. I'm trying to build an intuition regarding the usage of <code>lift</code>. I hope someone can provide that.</p>