title: Higher-order functions in Clojure
body: <p>Clojure is awesome, we all know this, but that's not the point. I'm wondering what the idiomatic way of creating and managing higher-order functions in a Haskell-like way is. In Clojure I can do the following:</p>
  
  <pre><code>(defn sum [a b] (+ a b))
  </code></pre>
  
  <p>But <code>(sum 1)</code> doesn't return a function: it causes an error. Of course, you can do something like this:</p>
  
  <pre><code>(defn sum
    ([a] (partial + a)) 
    ([a b] (+ a b)))
  </code></pre>
  
  <p>In this case:</p>
  
  <pre><code>user=&gt; (sum 1)
  #&lt;core$partial$fn__3678 clojure.core$partial$fn__3678@1acaf0ed&gt;
  user=&gt; ((sum 1) 2)
  3
  </code></pre>
  
  <p>But it doesn't seem like the right way to proceed. Any ideas?<br>
  I'm not talking about implementing the <code>sum</code> function, I'm talking at a higher level of abstraction. Are there any idiomatic patterns to follow? Some macro? Is the best way defining a macro or are there alternative solutions?</p>