
Hi Conal,
On 1/13/08, Conal Elliott
That eta-expansion desugaring would lose sharing.
Ah, that will be it.
1. Equations with different arities more often signal bugs than correct intentions.
I don't believe that. I suspect the type system will mop these up.
2. It's highly misleading.
Again, I don't believe that. Your argument holds for why we shouldn't have multiple equations for definition, not that they should all be the same arity.
Offhand, I don't know of a desugaring that would do the trick and preserve sharing. Any ideas? -
f = let body = sort . nub in \xs -> case xs of [] -> [1] (_:_) -> body
Compared to other desugarings in Haskell, this one is positively tame! I quite like the idea of permitting equations to have different arities. It removes restrictions, makes things more regular etc. Thanks Neil