title: How to implement "first" for ArrowApply?
body: <p>In <a href="http://www.cse.chalmers.se/~rjmh/afp-arrows.pdf" rel="nofollow">"Programming with Arrows"</a>, Hughes asserts </p>
  
  <blockquote>
    <p>First of all, note that both first and left are easy to implement in terms
    of app  (the details are left as an exercise).</p>
  </blockquote>
  
  <p>From Control.Arrow, <code>left</code> can be implemented as:</p>
  
  <pre><code>leftApp :: ArrowApply a =&gt; a b c -&gt; a (Either b d) (Either c d)
  leftApp f = arr ((\b -&gt; (arr (\() -&gt; b) &gt;&gt;&gt; f &gt;&gt;&gt; arr Left, ())) |||
                   (\d -&gt; (arr (\() -&gt; d) &gt;&gt;&gt; arr Right, ()))) &gt;&gt;&gt; app
  </code></pre>
  
  <p>How do I implement <code>first</code> with just <code>arr</code>, <code>&gt;&gt;&gt;</code>, and <code>app</code>?</p>