title: Removing duplication (with Applicative ((->) t), perhaps?)
body: <p>I was playing around with a simple function for someone else's Stack Overflow question, and wrote the expression:</p>
  
  <pre><code>f a x ++ f a y
  </code></pre>
  
  <p>Obviously this is the best way to write that expression in real life, given I have all those variables in scope anyway, but I saw the duplication of <code>f a</code>, and thought "Hey, maybe you can remove that with the Applicative instance for functions". I wound up with: </p>
  
  <pre><code>liftA2 (++) (flip f x) (flip f y) a
  </code></pre>
  
  <p>which is just awful. Is there some nicer way to remove this duplication?Obviously I could also remove the duplication by binding <code>f a</code> to something in a <code>where</code> clause, but this was intended as an exercise in using built-in functions.</p>