concept arity in category functional programming

appears as: rity, arity
Functional Programming in JavaScript

This is an excerpt from Manning's book Functional Programming in JavaScript.

Figure 1.4. The flow of data when composing two functions. The return value from find must be compatible in type and arity with the arguments to csv, which in turn returns information that append can use. Note that in order to make the flow of data clear, I flipped the order of the function calls.

Comparing figures 4.3 and 4.4 reveals a key difference between the approaches: chaining makes tight connections via an object’s methods, whereas a pipeline links inputs and outputs of any functions—arriving at loosely coupled components. But for this linkage to be possible, the connecting functions must be compatible in terms of arity and type, which we’ll examine next.

4.2.2. Functions and arity: the case for tuples

Arity can be defined as the number of arguments a function accepts; it’s also referred to as the function’s length. We usually take arity for granted in other programming paradigms, but in functional programming, as a corollary to referential transparency, the number of arguments a function declares is often directly proportional to its complexity. For instance, a function that works on a single string is likely much simpler than one taking three or four arguments: