4 ms·
`frequencies` is surprisingly useful, enough to justify its inclusion into core. I once pondered why. Consider that in Clojure, a common act transforming one d
by calibraxis 13y ago
`frequencies` is surprisingly useful, enough to justify its inclusion into core. I once pondered why.
Consider that in Clojure, a common act transforming one datastructure into another. Typically only a few kinds: maps, sets, and some kind of sequence.
What is a highly common generic transformation of a sequence to a map? `frequencies`. Particularly since you'd only be doing this with pretty finite sequences, given the finite nature of the built-in maps. Finite here means countable. What generic, domain-independent thing would you be counting? Often, the items themselves.