<div dir="ltr"><div>I don&#39;t know what is the best name for it, but I have found myself defining this function lot of times.<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 10, 2012 at 7:15 AM, Merijn Verstraaten <span dir="ltr">&lt;<a href="mailto:merijn@inconsistent.nl" target="_blank">merijn@inconsistent.nl</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I keep finding myself needing to apply functions to both elements in a tuple and now that I&#39;ve started playing around with AFRP libraries I find myself applying arrows to both sides of tuples there too. As a result I would like to propose the following addition to Control.Arrow:<br>

<br>
both :: Arrow a =&gt; a b c -&gt; a (b, b) (c, c)<br>
both = join (***)<br>
-- or if importing join from Control.Monad is undesirable<br>
both f = f *** f<br>
<br>
Why not just write &quot;f *** f&quot; I hear you ask? Because when f is not a trivial expression then you need to either bind it to a new name and use &quot;newName *** newName&quot; (which I personally dislike, because I&#39;m terrible at coming up with names) or write &quot;join (***) f&quot; which I don&#39;t find a particularly appealing notation either.<br>

<br>
Kind regards,<br>
Merijn Verstraaten<br>
<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
</blockquote></div><br></div>