<div dir="ltr">Both these function combinators and more concise operators for sources would be encompassed by user-defined infix operators. I expect this would be more work than the proposed patch, but if the demand for infix operators is high enough, I think this would be better than an ever-expanding unconfigurable hodgepodge of built-in operators.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 19, 2015 at 9:46 PM, Timothy Beyer <span dir="ltr"><<a href="mailto:beyert@fastmail.net" target="_blank">beyert@fastmail.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">At Thu, 19 Feb 2015 18:34:49 +0000 (UTC),<br>
<span class="">Gabriel Riba wrote:<br>
><br>
> Adam Chlipala <adamc <at> <a href="http://csail.mit.edu" target="_blank">csail.mit.edu</a>> writes:<br>
><br>
> ><br>
> > OK, I see.  By "functional," you meant "related to function application,<br>
> > composition, etc.", not a general mechanism for introducing new infix<br>
> > operators.<br>
> ><br>
> > If you (or anyone else) want to experiment with tweaking src/urweb.grm<br>
> > to add some new operators, I'll be happy to accept a patch embodying<br>
> > tasteful choices. :)  (May also require adding to lib/ur/top.ur[s] new<br>
> > definitions of conventionally named functions, to which the new<br>
> > operators desugar.)<br>
> ><br>
><br>
> Hello!<br>
><br>
> I've worked out a solution for the function application and composition<br>
> operators, after revising the mlton manuals for ml-lex and ml-yacc, and it<br>
> works.<br>
><br>
> I need your opinion to ensure if it is complete.<br>
><br>
> The operators in this trial are<br>
><br>
> (<|) : forward application (right associative), named FWDAPP in .lex and .grm<br>
> (|>) : reverse application (left associative), named REVAPP<br>
> (<<<) : right-to-left composition (right associative) (equivalent to ML's<br>
> (o)), named COMPOSE<br>
> (>>>) : left-to-right composition (right associative), named ANDTHEN<br>
<br>
</span>I can't speak for Adam, but I've wanted infix apply and compose operators in Ur/Web for a while, so I'm looking forward to trying this patch.<br>
<br>
If Ur/Web ever gains pattern matching on a function level (eg. without requiring an extra case statement), plus pattern matching extensions such as OR patterns, and more concise operators for sources, then it would be absolute bliss for me, even though what I suggest is quite a lot of syntactic sugar.<br>
<br>
Regards,<br>
Tim<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Ur mailing list<br>
<a href="mailto:Ur@impredicative.com">Ur@impredicative.com</a><br>
<a href="http://www.impredicative.com/cgi-bin/mailman/listinfo/ur" target="_blank">http://www.impredicative.com/cgi-bin/mailman/listinfo/ur</a><br>
</div></div></blockquote></div><br></div>