<div class="gmail_quote">On Wed, Jul 15, 2009 at 3:08 AM, Hans Aberg <span dir="ltr">&lt;<a href="mailto:haberg@math.su.se">haberg@math.su.se</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">On 15 Jul 2009, at 12:25, Eugene Kirpichov wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If ++ could be pattern matched, what should have been the result of<br>
&quot;let (x++y)=[1,2,3] in (x,y)&quot;?<br>
</blockquote>
<br></div>
It will branch. In terms of unification, you get a list of substitutions.</blockquote><div><br></div><div>f :: [a] -&gt; ([a],[a])</div><div>f (x ++ y) = (x,y)</div><div><br></div><div>If this pattern branches, it could hardly be considered a <i>function </i>which takes lists and returns pairs.  It would have to return something else.</div>
<div><br></div><div>Luke</div></div>