Erlang Central


From ErlangCentral Wiki

The arity of a function or an operator is the number of arguments or operands it takes.

In Erlang a function of arity 2 can be abbreviated as


This is important in the Exports section of an Erlang Module

It's important to understand that no two functions in a module can have the same number of arguments, while having different argument types. The combination of name and arity fully identifies one function in a module. This is mirrored in several OTP calling conventions, that require a module name, a function name, and an argument list. The length of the list matches the arity of the function sought.