Pervasion

Pervasion during function application is the concept of a function being defined in terms of the simple scalars in nested arrays. It is a feature of nested array languages, while flat array languages usually do have function pervade into boxes. Pervasion can be seen as and modelled by recursing into all nested elements until the function can be applied to all simple scalars.

Scalar functions exhibit pervasion by default, whereas mixed functions and user defined functions do not. The pervading behaviour can be obtained for any function by using enough consecutive Each operators  to reach the simple scalars at the deepest point of nesting in any argument.

In dialects with the Depth operator, a function can be made pervasive with :

Try it online!

In dzaima/APL the dyadic form of Depth is not yet implemented, so this definition will only work for monadic function application

In dialects that support dfns, this operator can be defined as:

In all dialects that support user defined tradops, the operator for monadic function application can be defined as: