Frequency counts (how many) and accumulations (how much) are everyday programming tasks. Yet, there are no primitive APL functions for solving these problems directly. Instead, you dig into your bag of techniques and use some clever shifting or inner/outer product method to do the job. This paper proposes a primitive syntax for generally computing frequency counts, accumulations and cross-tabulations (which are multidimensional frequency counts and accumulations). The aim of the paper is not to encourage the implementation of a new primitive function; rather, it offers a mental model: a way to view this class of problems. A user-defined function that implements the model is shown on page 28.
/lp/association-for-computing-machinery/frequency-counts-accumulations-and-cross-tabulations-in-apl-Lc9XFuzyMn