<div>(*&gt;) and (&lt;*) could be used to apply recognizing parsers for the discarded half. This makes a huge gain for uu-parsinglib. uu-parsinglib&#39;s P_m monad could be extended just as it has done with P_f and P_h to also wrap its existing R monad, which would let it apply the parser as a recognizer efficiently.</div>

<div> </div>
<div>And for parsimony it allows me to treat that side of the alternative grammar as a right seminearring ignoring the argument, this increases sharing opportunities for my grammar fragments, because pure nodes in recognizers can be treated as epsilons in the grammar and safely elided.</div>

<div> </div>
<div>-Edward Kmett<br></div>
<div class="gmail_quote">On Wed, Aug 19, 2009 at 11:40 AM, Ross Paterson <span dir="ltr">&lt;<a href="mailto:ross@soi.city.ac.uk">ross@soi.city.ac.uk</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">On Mon, Jun 29, 2009 at 01:45:45PM +0100, Ross Paterson wrote:<br>&gt; The proposal is that the following functions<br>&gt;<br>&gt;     (&lt;$) :: Functor f =&gt; a -&gt; f b -&gt; f a<br>&gt;     (*&gt;) :: Applicative f =&gt; f a -&gt; f b -&gt; f b<br>
&gt;     (&lt;*) :: Applicative f =&gt; f a -&gt; f b -&gt; f a<br>&gt;     some :: Alternative f =&gt; f a -&gt; f [a]<br>&gt;     many :: Alternative f =&gt; f a -&gt; f [a]<br>&gt;<br>&gt; are moved into the corresponding classes, with the existing implementations<br>
&gt; as default definitions.<br><br></div>Henning asked for concrete examples (i.e. code) where this would give<br>a substantial performance win while still defining the same function,<br>including termination properties.  (But it seems reasonable not to rely<br>
on RULES to improve the asymptotic complexity.)<br><br>I gave an example for (&lt;$).  Does anyone have concrete examples for<br>the others?<br>
<div>
<div></div>
<div class="h5">_______________________________________________<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>
</div></div></blockquote></div><br>