title: When should I use function currying?
body: <p><a href="https://stackoverflow.com/questions/18718232/when-should-i-write-my-functions-in-curried-form">When should I write my functions in curried form?</a> does not match my thought, need to correct myself.</p>
  
  <p>As part of my learning <a href="http://inst.eecs.berkeley.edu/~cs61a/fa12/slides/06.py" rel="noreferrer">link</a>, this is what I understand from function currying. Below is one example:</p>
  
  <pre><code>def curry2(f):
      """Returns a function g such that g(x)(y) == f(x, y)
  
      &gt;&gt;&gt; from operator import add
      &gt;&gt;&gt; add_three = curry2(add)(3)
      &gt;&gt;&gt; add_three(4)
      """
      def g(x):
          def h(y):
              return f(x, y)
          return h
      return g
  </code></pre>
  
  <p>In any application, if I know that the number of arguments are fixed (say 2 arguments) and
  function name is <code>normalise_range</code>(say), then I will define <code>def normalise_range(x, y):</code> function and use it in my application directly by calling <code>normalise_range(x, y)</code>.</p>
  
  <p>In any application, if I know that, the number of arguments are fixed (say 2 arguments),
  but the function name is varying (can be <code>normalise_range</code>/<code>average</code>/I don't know..),
  then I will use <code>def curry2(f):</code> as shown above, which will accept all functions that take two arguments (fixed).</p>
  
  <p>My question:</p>
  
  <ol>
  <li>Is my understanding correct?</li>
  <li>If yes, can we think of currying for functions of variable number of arguments?</li>
  </ol>