<br><div class="gmail_quote">On Mon, Sep 13, 2010 at 3:39 PM, Nils Anders Danielsson <span dir="ltr"><<a href="mailto:nad@cs.nott.ac.uk">nad@cs.nott.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 2010-09-13 14:30, Jean-Philippe Bernardy wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On a related note, is there a way to give the associativity/precedence<br>
of the new notation?<br>
</blockquote>
<br>
Fixities can already be specified for any names, so the fixity of the<br>
name will be used.<br>
</blockquote>
<br></div>
This seems wrong to me. Contrived example:<br>
<br>
_◅_ : A → List A → List A<br>
<br>
infixr 5 _◅_<br>
<br>
syntax _◅_ x xs = xs ▻ x<br>
<br>
I would like to be able to specify that xs ▻ x ▻ y should be parsed as<br>
(xs ▻ x) ▻ y, i.e. left associatively. I think it should be possible to<br>
specify the fixity of the new syntax separately from that of the old.<br>
<br>
Another option is to only allow syntax declarations for non-operator<br>
identifiers. In this case a fixity declaration for the identifier would<br>
apply to the syntax (and fixity declarations for non-operator<br>
identifiers without syntax would not be allowed). I think I prefer this<br>
option.<br></blockquote><div><br></div><div>Yes, that seems to be the most sensible option. That way naming your</div><div>function _+_ can be seen as shorthand for</div><div><br></div><div>syntax _+_ x y = x + y</div><div>
<br></div><div>/ Ulf</div></div>