title: Can we determine function "k", if we know k(l-1)=f(l) holds for all function f of type int->int and l of type int?
body: <p>Suppose both k and f are functions of type int -&gt; int. If we know k(l-1)=f(l) holds for all l of type int, can we be certain that k is the function  v-&gt;f(v+1) ?</p>
  <p>I have this question while doing an exercise of functional programming: to transform a length function</p>
  <pre><code>let rec len xs = 
    match xs with 
      | [] -&gt; 0 
      | x:xr -&gt; 1 + len xr;;
  </code></pre>
  <p>to a continuation-passing version. My answer to the exercise would be</p>
  <pre><code>   let rec lenc xs k = 
        match xs with 
          | [] -&gt; k 0 
          | x:xr -&gt; lenc xr (fun v -&gt; k(v+1))
  </code></pre>
  <p>but I am unsure if the <code>(fun v -&gt; k(v+1))</code> part can be replaced by other solutions. To know this, we would need to determine a unique &quot;k&quot;, given that k(l-1)=f(l) holds for all function f of type int-&gt;int and l of type int?</p>