<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Last I checked,<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">(&) = flip ($)<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">

is both shorter to type, and more explicit than:<br><br>import Control.Apply.Reverse<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">  - Clark<br></div></div><div class="gmail_extra"><br><br>

<div class="gmail_quote">On Thu, Apr 17, 2014 at 2:03 PM, Hans Höglund <span dir="ltr"><<a href="mailto:hans@hanshoglund.se" target="_blank">hans@hanshoglund.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word"><div><br></div><div>There is also is my humble attempt to standardize the (&) formulation: </div><div><br></div><div><span style="white-space:pre-wrap">   </span><a href="http://hackage.haskell.org/package/reverse-apply" target="_blank">http://hackage.haskell.org/package/reverse-apply</a></div>

<div><br></div><div>As you can see, these definitions now mirror those in 'lens' exactly. I see no reason why this definition should not move to base. IMHO, the Diagrams definition is a very specific one based on the needs of that EDSL, while the lens formulation is the expected one.</div>

<div><br></div><div>Mvh,</div><div>Hans</div><div><br></div><br><div><div>On 17 apr 2014, at 14:00, <a href="mailto:haskell-cafe-request@haskell.org" target="_blank">haskell-cafe-request@haskell.org</a> wrote:</div><br><blockquote type="cite">

<span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium">Message: 1<br>

Date: Wed, 16 Apr 2014 16:49:31 -0700<br>From: Dan Burton <<a href="mailto:danburton.email@gmail.com" target="_blank">danburton.email@gmail.com</a>><br>To: Alexey Muranov <<a href="mailto:alexey.muranov@gmail.com" target="_blank">alexey.muranov@gmail.com</a>><br>

Cc: haskell-cafe <<a href="mailto:haskell-cafe@haskell.org" target="_blank">haskell-cafe@haskell.org</a>><br>Subject: Re: [Haskell-cafe] Syntax proposal for "reverse<br><span style="white-space:pre-wrap">     </span>apply"/"pipeline apply" (flip ($))<br>

Message-ID:<br><span style="white-space:pre-wrap">        </span><<a href="mailto:CALSygwf0wdBbrfQeED_raWjNfttYaX7pwDTzmBTTHaUqEkX5rg@mail.gmail.com" target="_blank">CALSygwf0wdBbrfQeED_raWjNfttYaX7pwDTzmBTTHaUqEkX5rg@mail.gmail.com</a>><br>

Content-Type: text/plain; charset="utf-8"<div class=""><br><br>In the "lens" package, this is (&) at infixl 1. In the "diagrams" package,<br>this is (#) at infixl 8. You're certainly not the first to want this, but<br>

nobody can ever agree what it should be called or what fixity it should<br>have. You can always just define it yourself.<br><br></div>-- Dan Burton<br><br><br><div class="">On Wed, Apr 16, 2014 at 3:25 PM, Alexey Muranov <<a href="mailto:alexey.muranov@gmail.com" target="_blank">alexey.muranov@gmail.com</a>>wrote:<br>

<br><blockquote type="cite">Hello,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">i am completely new to Haskell, but i am somewhat fascinated by<br></blockquote><blockquote type="cite">
lambda-calculus and programming.<br>
</blockquote><blockquote type="cite"><br></blockquote></div><div class=""><blockquote type="cite">For whatever it is worth, i would like to propose for discussion a syntax<br></blockquote><blockquote type="cite">for "(flip ($))" operation in Haskell.<br>

</blockquote><blockquote type="cite"><br></blockquote></div><div class=""><blockquote type="cite">I think that a good syntax would be "|^", for example:<br></blockquote><blockquote type="cite"><br></blockquote>
<blockquote type="cite">
   square x = x * x<br></blockquote><blockquote type="cite">   y = 3 |^ square             -- y == 9<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">

Explanation:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">* i would have suggested just ^, but it would conflict with number<br></blockquote><blockquote type="cite">exponentiation,<br>
</blockquote>
<blockquote type="cite"><br></blockquote><blockquote type="cite">* it is rather common in mathematics to write function application in<br></blockquote><blockquote type="cite">exponential notation:  x ^ f  instead of  f(x), especially if  f  is an<br>

</blockquote><blockquote type="cite">automorphism of some structure,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">* (flip ($)) is exactly the exponentiation of Church numerals,<br></blockquote>

<blockquote type="cite"><br></blockquote><blockquote type="cite">* in "The calculi of lambda-conversion", Alonzo Church uses the<br></blockquote><blockquote type="cite">"shorthand" notation "[N^M]" for "(MN)", where M and N are lambda-terms.<br>

</blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">* I am probably not the only person missing the ability to apply functions<br></blockquote><blockquote type="cite">from the right:<br></blockquote>

<blockquote type="cite"><br></blockquote><blockquote type="cite"><a href="http://stackoverflow.com/questions/1457140/haskell-composition-vs-fs-pipe-forward-operator" target="_blank">http://stackoverflow.com/questions/1457140/haskell-composition-vs-fs-pipe-forward-operator</a><br>

</blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Well, other notations i've thought of are "\^" and "~$".<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">

Alexey.<br></blockquote></div><blockquote type="cite">_______________________________________________<br></blockquote><div class=""><blockquote type="cite">Haskell-Cafe mailing list<br></blockquote><blockquote type="cite">

<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br></blockquote><blockquote type="cite"><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>

</blockquote><blockquote type="cite"><br></blockquote></div>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <<a href="http://www.haskell.org/pipermail/haskell-cafe/attachments/20140416/818eebe7/attachment-0001.html" target="_blank">http://www.haskell.org/pipermail/haskell-cafe/attachments/20140416/818eebe7/attachment-0001.html</a>><br>

<br>------------------------------<br><br>Message: 2<br>Date: Wed, 16 Apr 2014 16:56:37 -0700 (PDT)<br>From: Alexey Muranov <<a href="mailto:alexey.muranov@gmail.com" target="_blank">alexey.muranov@gmail.com</a>><br>

To:<span> </span><a href="mailto:haskell-cafe@googlegroups.com" target="_blank">haskell-cafe@googlegroups.com</a><br>Cc: haskell-cafe <<a href="mailto:haskell-cafe@haskell.org" target="_blank">haskell-cafe@haskell.org</a>><br>

Subject: Re: [Haskell-cafe] Syntax proposal for "reverse<br><span style="white-space:pre-wrap">      </span>apply"/"pipeline apply" (flip ($))<br>Message-ID: <<a href="mailto:0569e94e-44b8-44a0-abe3-4bd7d80b2ed4@googlegroups.com" target="_blank">0569e94e-44b8-44a0-abe3-4bd7d80b2ed4@googlegroups.com</a>><br>

Content-Type: text/plain; charset="utf-8"<div><div class="h5"><br><br>On Thursday, April 17, 2014 1:49:31 AM UTC+2, Dan Burton wrote:<br><br><blockquote type="cite">In the "lens" package, this is (&) at infixl 1. In the "diagrams" package,<span> </span><br>

</blockquote><blockquote type="cite">this is (#) at infixl 8. You're certainly not the first to want this, but<span> </span><br></blockquote><blockquote type="cite">nobody can ever agree what it should be called or what fixity it should<span> </span><br>

</blockquote><blockquote type="cite">have. You can always just define it yourself.<br></blockquote><blockquote type="cite"><br></blockquote><br>(#) does not look too bad either.<span> </span><br></div></div>-------------- next part --------------<br>

An HTML attachment was scrubbed...<br>URL: <<a href="http://www.haskell.org/pipermail/haskell-cafe/attachments/20140416/ccada62f/attachment-0001.html" target="_blank">http://www.haskell.org/pipermail/haskell-cafe/attachments/20140416/ccada62f/attachment-0001.html</a>><br>

<br>------------------------------<br><br>Message: 3<br>Date: Wed, 16 Apr 2014 18:41:01 -0700<br>From: Dan Burton <<a href="mailto:danburton.email@gmail.com" target="_blank">danburton.email@gmail.com</a>><br>To: Alexey Muranov <<a href="mailto:alexey.muranov@gmail.com" target="_blank">alexey.muranov@gmail.com</a>><br>

Cc: haskell-cafe <<a href="mailto:haskell-cafe@haskell.org" target="_blank">haskell-cafe@haskell.org</a>>,<br><span style="white-space:pre-wrap">   </span><a href="mailto:haskell-cafe@googlegroups.com" target="_blank">haskell-cafe@googlegroups.com</a><br>

Subject: Re: [Haskell-cafe] Syntax proposal for "reverse<br><span style="white-space:pre-wrap">      </span>apply"/"pipeline apply" (flip ($))<br>Message-ID:<br><span style="white-space:pre-wrap">        </span><<a href="mailto:CALSygwdyxhNLafMZDm15iVzPO4qYytdC7q2fDRhabNWJ4Vrb=g@mail.gmail.com" target="_blank">CALSygwdyxhNLafMZDm15iVzPO4qYytdC7q2fDRhabNWJ4Vrb=g@mail.gmail.com</a>><br>

Content-Type: text/plain; charset="utf-8"<div class=""><br><br>Interesting. I've never seen it proposed as right-associative before. Just<br>FYI, the implementation is as simple as this:<br><br>infixr 1 |^<br>

(|^) :: a -> (a -> b) -> b<br>x |^ f = f x<br><br>Then you can write:<br><br>3 |^ 2 |^ (^) -- produces 2^3 = 8<br><br>It seems very odd to me. I don't know why you'd want to apply the arguments<br>backwards one by one. However, lens and diagrams both provide examples<br>

where you want to start with a value and apply functions "forwards" one by<br>one, which is why their corresponding operators are left-associative.<br><br>-- Dan Burton</div></span></blockquote></div><br></div>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Clark.<br><br><span style="font-family:courier new,monospace"><span style="color:rgb(153,153,153)"><font size="1">Key ID     : 0x78099922<br>Fingerprint: B292 493C 51AE F3AB D016  DD04 E5E3 C36F 5534 F907</font></span></span></div>


</div>