omitting params in function bindings

Is there a deep reason (beyond saving a sentence or two in the language definition) for requiring all patterns in a function binding to have the same explicit arity? For example, in dropWhile0 :: Num a => [a] -> [a] dropWhile0 (0:xs) = dropWhile0 xs dropWhile0 xs = xs why shouldn't the last line be replaceable by dropWhile0 = id

Doug McIlroy wrote:
Is there a deep reason (beyond saving a sentence or two in the language definition) for requiring all patterns in a function binding to have the same explicit arity?
Perhaps it is more likely that a clause omitting an argument is a mistake by the programmer, than that it was an intentional eta- conversion. Regards, Malcolm

There is the property that once you 'move across the = to the right', the
pattern matcher isn't allowed to backtrack and try other patterns any more,
which might introduce some funny business. Though, I can't -- at the moment
-- come up with a way that it would break anything.
-Edward Kmett
On Tue, Nov 17, 2009 at 2:20 PM, Doug McIlroy
Is there a deep reason (beyond saving a sentence or two in the language definition) for requiring all patterns in a function binding to have the same explicit arity?
For example, in dropWhile0 :: Num a => [a] -> [a] dropWhile0 (0:xs) = dropWhile0 xs dropWhile0 xs = xs why shouldn't the last line be replaceable by dropWhile0 = id _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (3)
-
Doug McIlroy
-
Edward Kmett
-
Malcolm Wallace