On Tue, Nov 20, 2012 at 2:14 PM, John Wiegley <span dir="ltr">&lt;<a href="mailto:johnw@fpcomplete.com" target="_blank">johnw@fpcomplete.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Moving discussion from <a href="http://hackage.haskell.org/trac/ghc/ticket/7435" target="_blank">http://hackage.haskell.org/trac/ghc/ticket/7435</a>:<br>
<br>
I propose adding the following three functions to Data.Tuple and<br>
Data.Function, respectively:<br>
<br>
    swap :: (a,b) -&gt; (b,a)<br>
    swap = snd &amp;&amp;&amp; fst<br>
<br></blockquote><div><br></div>Data.Tuple already contains swap.<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Fairly obvious, but strangely missing.<br>
<br>
    compose :: [(a -&gt; a)] -&gt; a -&gt; a<br>
    compose = foldr (.) id<br>
<br>
    composeM :: [(a -&gt; m a)] -&gt; a -&gt; m a<br>
    composeM = foldr (&lt;=&lt;) return<br></blockquote><div> </div><div>I would actually consider these to fall beneath the &quot;Fairbairn threshold&quot;. </div><div><br></div><div>The composition of them is obvious, and the suggested names already exist commonly in a lot of third party code for all sorts of purposes.</div>
<div><br></div><div>The pain of adoption plus the annoyance of trying to find them exceeds, to me, the utility of adding them.</div><div><br></div><div>-Edward</div><div> </div></div>