Version française
Home     About     Download     Resources     Contact us    
Browse thread
anonymous function + lable bug?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chris Hecker <checker@d...>
Subject: Re: anonymous function + lable bug?

>> I thought these two were equivalent?
>They are not:

Right, I didn't mean to say they're completely equivalent (I've read the FAQ), just that I expected equivalence in that case.

>It would be possible to add special rules to allow
>        function ~l:p1 -> e1 | ... | ~l:pn -> en

Ah, now I see, it's because the parameter in function is actually the pattern in an implicit match?

Is there ever a reason to use function (assuming you don't mind parenthesizing constructors and whatnot in fun arguments)?  Does the implied match allow some simplification or optimization or something?  Why do they both exist?

As I said, I've read the FAQ, but I can't see why you'd ever use function when you've got fun...

Thanks,
Chris