<br><div class="gmail_quote">On Tue, Nov 20, 2012 at 3:32 PM, Dan Burton <span dir="ltr">&lt;<a href="mailto:danburton.email@gmail.com" target="_blank">danburton.email@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Functional metapost called it (#). But for me (&gt;&gt;&gt;) is ok. It is even more descriptive than (&amp;).</blockquote>


<div><br></div></div><div>The reason I feel that &gt;&gt;&gt; is inadequate is because it requires that you use either parens or $ in order to finally apply the chain of functions to a value. Also, being part of a typeclass can scare newcomers from using/understanding it.</div>


<div><br></div><div><font face="courier new, monospace">(foo &gt;&gt;&gt; bar &gt;&gt;&gt; baz) val</font></div><div><font face="courier new, monospace">foo &gt;&gt;&gt; bar &gt;&gt;&gt; baz $ val</font></div><div><br></div>


<div>Blegh.</div><div><br></div><div>Part of the reason I like |&gt; is because it <i>is</i> a little more clutter-y than &amp;. This forces you to use it prudently, with adequate whitespace. For example, when I was writing a StackOverflow answer[1] a few days ago, I found that using this operator was unreadable unless I used additional newlines. Lining up the |&gt; operators actually produces a rather nice visual effect, as if you were entering each transformation at a command prompt. The vertical bars lining up is also nice. Consider the &quot;butt-ugly&quot; code (according to Thomas):</div>
<div class="im">

<div><br></div> (&quot;hello&quot;,&quot;world&quot;)  &amp;  _1.traverse %~ toUpper  &amp; _2 .~ 42<br></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"></div>Rewritten with whitespace, it can look much prettier:<div><span style="color:rgb(80,0,80);font-size:13px;font-family:arial,sans-serif"><br>

</span></div><div><font face="courier new, monospace">(&quot;Hello&quot;, &quot;world&quot;)</font></div><div><font face="courier new, monospace">  |&gt; _1.traverse %~ toUpper</font></div><div><font face="courier new, monospace">  |&gt; _2          .~ 42</font></div>
</blockquote><div><br></div><div>You can make pretty much any mishmash of operators more palatable by creative spacing and lots of newlines. If you dig around in the lens code, many of the uses of (&amp;) are spaced exactly this way.</div>
<div><br></div><div>The case is perhaps made better by DSLs that themselves aren&#39;t operator ridden, so we don&#39;t get muddled in precedence issues:<div><br></div><div>&gt;&gt;&gt; def &amp; forward 10 &amp; down &amp; turn (pi/2) &amp; forward 5</div>
<div><div><div>Turtle {_tPoint = Point {_x = 5.0, _y = 10.0}, _tColor = Color {_r = 0, _g = 0, _b = 0}, _heading = 1.5707963267948966, _penDown = True}</div></div></div></div><div><br></div><div>When the operations are as individually small as I sketched above though, the overhead of that operator accretes pretty fast, and the overhead of all those newlines gets silly. =) Admittedly, I perhaps should have chosen an example where the (|&gt;) looks less like the turtle in question. ;)</div>
<div><br></div><div>-Edward</div></div>