[Haskell-cafe] omitting params in function bindings
ekmett at gmail.com
Wed Nov 18 01:00:34 EST 2009
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.
On Tue, Nov 17, 2009 at 2:20 PM, Doug McIlroy <doug at cs.dartmouth.edu> 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?
> 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 at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe