On Wed, Jul 15, 2009 at 3:08 AM, Hans Aberg <haberg@math.su.se> wrote:
On 15 Jul 2009, at 12:25, Eugene Kirpichov wrote:

If ++ could be pattern matched, what should have been the result of
"let (x++y)=[1,2,3] in (x,y)"?

It will branch. In terms of unification, you get a list of substitutions.

f :: [a] -> ([a],[a])
f (x ++ y) = (x,y)

If this pattern branches, it could hardly be considered a function which takes lists and returns pairs.  It would have to return something else.

Luke