[Haskell-cafe] omitting params in function bindings

Doug McIlroy doug at cs.dartmouth.edu
Tue Nov 17 14:20:38 EST 2009

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

More information about the Haskell-Cafe mailing list