[Haskell-cafe] All equations must have the same arity - why?

Jonathan Cast jonathanccast at fastmail.fm
Sun Jan 13 20:44:23 EST 2008

On 13 Jan 2008, at 5:38 PM, jerzy.karczmarczuk at info.unicaen.fr wrote:

> Neil Mitchell writes:
>>  I quite like the idea of permitting equations to have different
>> arities. It removes restrictions, makes things more regular etc.
> More regular???
> My goodness... Of course, it removes restrictions. But in the  
> history of
> humanity rarely the removal of restrictions made things more regular!
> Sometimes it is useful, but not where it "for free" gives you more
> opportunities to make bugs.
> I wonder whether
> f = g
> and
> f x = g x
> attributes *always* the same type to both variants of f...

A related variant of this is trivial:

f x = x
f x y = x y

I don't know if eliminating that last argument has similar properties  
in practice or not.

OTOH, the question is only one of eta-expanding until you get a  
number of arguments we already /know/ the function takes.


More information about the Haskell-Cafe mailing list