[Haskell-cafe] omitting params in function bindings

Edward Kmett 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.

-Edward Kmett

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
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091118/990909e7/attachment.html

More information about the Haskell-Cafe mailing list