[Haskell-cafe] different arities

Henning Sato Rosen henning.von.rosen at gmail.com
Tue Nov 2 18:21:33 EST 2004


> You have met up with one of the rules for function bindings in standard
> Haskell (http://www.haskell.org/onlinereport/decls.html). The use of "arity"
> in the error message is a poor choice of words. The rule is that each clause
> in the function binding must contain the same number of argument patterns.

Oh, I see, thanks Scott and Marco for answering! I am beginning to
realise that everything worth knowing about Haskell really is in the
report:-)

Regards/Henning

--------------------------------------------------------------------------------------------------

BTW, what might the reason for that be, is it for the sake of ease of
translation/implementation, or for the sake of some principle?   I
mean, as soon as a person realises that there are multiple syntaxes
for declaring a function, he/she will unify them to one abstract
function in the head (where the resulting type matters, not the
syntax).
So, even if one probably should avoid mixing as in the example, for
readability reasons, one might still argue that the restriction goes
against PoLS.
 
Just a thought.


More information about the Haskell-Cafe mailing list