Apply an aggregate to groups

(aggr;d) fby g

Where

collects the items of d into sublists according to the corresponding items of g, applies aggr to each sublist, and returns the results as a vector with the same count as d.