title: Conditional elements in -> / ->> pipelines
body: <p>Given a <code>-&gt;&gt;</code> pipeline like so:</p>
  
  <pre><code>(defn my-fn []
    (-&gt;&gt; (get-data)
         (do-foo)
         (do-bar)
         (do-baz)))
  </code></pre>
  
  <p>I wish to make the various stages conditional.</p>
  
  <p>The first way of writing this that came to mind was as such:</p>
  
  <pre><code>(defn my-fn [{:keys [foo bar baz]}]
    (-&gt;&gt; (get-data)
         (if foo (do-foo) identity)
         (if bar (do-bar) identity)
         (if baz (do-baz) identity))
  </code></pre>
  
  <p>However, as the <code>-&gt;&gt;</code> macro attempts to insert into the <code>if</code> form, this not only looks unfortunate in terms of performance (having the noop <code>identity</code> calls), but actually fails to compile.</p>
  
  <p>What would an appropriate, reasonably DRY way of writing this be?</p>